Re: print matching elements of a list

From: Walter Roberson (roberson_at_ibd.nrc-cnrc.gc.ca)
Date: 02/01/04


Date: 1 Feb 2004 00:51:56 GMT

In article <d7f4b71b2d93f415589ece825b22bafd@tatooine.homelinux.net>,
starwars <nobody@tatooine.homelinux.net> wrote:
:I want to print x, if a $var matches any of the elements of a list.

:How do I write that?

Is that matches as in a regular expression, or is that matches
as in equality?

If it is regular expressions, then

perldoc -q "How do I efficiently match many regular expressions at once?"
to get the answer from the perl faq.

If it is equality, then

perldoc -q "How can I tell whether a certain element is contained in a list or array?

for a discussion of several techniques from the perl faq.

-- 
Contents: 100% recycled post-consumer statements.


Relevant Pages