Isn't this what smart matching is for (if you have 5.10+)?
>perl -wMstrict -lE "my @colors = qw(red green blue yellow); my @bands = qw(green pink); ;; say qq{$bands[0] matches} if $bands[0] ~~ @colors; say qq{$bands[1] matches} if $bands[1] ~~ @colors; " green matches
In reply to Re: If condition operator
by AnomalousMonk
in thread If condition operator
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |