TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TCLUG:21227] Newbie perl question
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@talkware.net, on 09/12/2000 02:30:25 PM
To: tclug-list@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@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@mn-linux.org
For additional commands, e-mail: tclug-list-help@mn-linux.org