Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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?
LanX "If Croesus goes to war he will destroy a great empire."
[LanX]: s/Croesus/May/

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2017-03-29 10:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (344 votes). Check out past polls.