My example doesn't create an additional array, either.  ;P

You can sign up for tclug-devel at www.mn-linux.org.

Nick Reinking





cbidler at talkware.net, on 09/12/2000 02:30:25 PM
To: tclug-list at mn-linux.org @ PMDF
cc:  
Subject: Re: [TCLUG:21227] Newbie perl question

"Gabe Turner (officer)" wrote:
> 
> This would work, but then he'd have an array with a bunch of NULLs in it.
> So, if he's got a majordomo mailing list, say, it'd try to send messages to
> an email address called NULL.
> 
> Gabe

How about this:

my @tmp;
foreach @addrs {
  if($_ ne $addr){
    push @tmp, ($_);
  }
}
@addrs = @tmp;

This does create an 'extra' array, but the overhead is small to get an array
with no NULLs, IMHO. :)
-- 
<---------------------------------------------------------------------->
 Chris H. Bidler                                   cbidler at talkware.net 
 Associate Engineer, Applications Group               
 Universal Talkware Corp.

 "In any event, is a O^(log N) search that returns the wrong answer
  really better than an O^N search that returns the right answer?"
<---------------------------------------------------------------------->

---------------------------------------------------------------------
To unsubscribe, e-mail: tclug-list-unsubscribe at mn-linux.org
For additional commands, e-mail: tclug-list-help at mn-linux.org




-------------- next part --------------
---------------------------------------------------------------------
To unsubscribe, e-mail: tclug-list-unsubscribe at mn-linux.org
For additional commands, e-mail: tclug-list-help at mn-linux.org