Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by mje (Curate)
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 drinking their drinks and smoking their pipes about the Monastery: (18)
As of 2014-10-30 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls