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

Re^2: How to check if a variable's value is equal to a member of a list of values

by mje (Deacon)
on Mar 25, 2013 at 16:35 UTC ( #1025340=note: print w/ replies, xml ) Need Help??


in reply to Re: How to check if a variable's value is equal to a member of a list of values
in thread How to check if a variable's value is equal to a member of a list of values

Be careful as on newer perl versions:

$ perl -le '@a = (1,2,3); print "fred\n" if @a ~~ 1;' # prints nothing $ perl -le '@a = (1,2,3); print "fred\n" if 1 ~~ @a;' fred

I think it changed at 5.10.1 but I didn't check that.


Comment on Re^2: How to check if a variable's value is equal to a member of a list of values
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2014-07-29 01:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls