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.
In Section
Seekers of Perl Wisdom