in reply to If condition operator

A few other approaches...

grep

if (grep { $bands[0] eq $_ } qw(red green blue yellow))

List::MoreUtils

use List::MoreUtils qw(any); if (any { $bands[0] eq $_ } qw(red green blue yellow))

Hash, map, exists

my %colors = map { $_ => 1 } qw(red green blue yellow); if (exists $colors{$bands[0]})