Help for this page

Select Code to Download


  1. or download this
    if (grep { $bands[0] eq $_ } qw(red green blue yellow))
    
  2. or download this
    use List::MoreUtils qw(any);
    if (any { $bands[0] eq $_ } qw(red green blue yellow))
    
  3. or download this
    my %colors = map { $_ => 1 } qw(red green blue yellow);
    if (exists $colors{$bands[0]})