Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: matching elements in a list in a logical OR fashion

by mako132 (Initiate)
on Jun 15, 2004 at 14:19 UTC ( [id://366900]=note: print w/replies, xml ) Need Help??


in reply to matching elements in a list in a logical OR fashion

It'll be in Perl6 and is available now in Perl6::Rules. From the perldoc:

An interpolated array:

use Perl6::Rules; @cmds = ('get','put','save','load','dump','quit'); $str =~ m/ @::cmds /;
matches if any of its elements eq matches the string at that point. So the above example is equivalent to:
$str =~ /get|put|save|load|dump|quit/;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://366900]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-03-29 02:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found