in reply to If condition operator

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