Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: using grep to match more than two words

by Samy_rio (Vicar)
on Jun 12, 2007 at 06:25 UTC ( [id://620638]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    my @arr1  = ("Sun", "Moon", "Venus", "Pluto", "Neptune"); 
    ((grep/^(Sun|Moon)$/, @arr1) == 2) ? (print "True") : (print "False");
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-04-16 17:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found