TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TCLUG:21227] Newbie perl question
Try this (don't know if it's the best way, but it's the first thing that
came to me):
foreach my $address (@addrlist) {
if ( $addr eq $address ) {
$address = "";
}
}
Though, this may leave you with "blank spaces" in your array, but I think
perl may fix it for you.
Gabe
On Tue, Sep 12, 2000 at 02:15:22PM -0500, Dave Sherohman wrote:
> I've got a list of email addresses, @addrlist, and an address, $addr, which
> may or may not be in @addrlist and, if it is there, should be removed.
>
> What's the easiest way to locate and remove $addr from @addrlist?
>
> --
> "Two words: Windows survives." - Craig Mundie, Microsoft senior strategist
> "So does syphillis. Good thing we have penicillin." - Matthew Alton
> Geek Code 3.1: GCS d- s+: a- C++ UL++$ P+>+++ L+++>++++ E- W--(++) N+ o+
> !K w---$ O M- V? PS+ PE Y+ PGP t 5++ X+ R++ tv b+ DI++++ D G e* h+ r++ y+
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tclug-list-unsubscribe@mn-linux.org
> For additional commands, e-mail: tclug-list-help@mn-linux.org
--
--------------------------------------------------------------------------------
Gabe Turner | X-President,
UNIX Systems Administrator, | Assoc. for Computing Machinery
U of M Supercomputing Institute for | Univerisity of Minnesota
Digital Simulation and Advanced Computation | dopp@acm.cs.umn.edu
"Look! It's my magic nose goblins!" -- Stimpy
"I finally get a good look at 'em!" -- Sven
- Stimpson J. Cat and Sven Hoek in "Sven Hoek"
--------------------------------------------------------------------------------