if (grep { $bands[0] eq $_ } qw(red green blue yellow))
use List::MoreUtils qw(any); if (any { $bands[0] eq $_ } qw(red green blue yellow))
my %colors = map { $_ => 1 } qw(red green blue yellow); if (exists $colors{$bands[0]})
In reply to Re: If condition operator
by toolic
in thread If condition operator
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |