TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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@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?"
<---------------------------------------------------------------------->