good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Remove elements from an arrayby revdiablo (Prior) |
on Nov 23, 2004 at 18:04 UTC ( [id://409948]=note: print w/replies, xml ) | Need Help?? |
As ikegami says, you should use grep. He gives a good example for excluding elements based on a regular expression, but you might also want to exclude elements based on string equality (which would be far faster, though a different algorithm would probably be even better):
Or, perhaps you want to search for a substring:
Just trying to give you some more ideas of how you can use grep... HTH Update: no fair! ikegami updated his post in the time while I was posting this. Cheater. :-)
In Section
Seekers of Perl Wisdom
|
|