Help for this page

Select Code to Download


  1. or download this
    my ($result2) = map { $array[$_][0] =~ /goat/ ? $_ : () } 0..$#array;
    my ($result3) = grep { $array[$_][0] =~ /goat/ } 0..$#array;
    
  2. or download this
    my $result2 = (map { $array[$_][0] =~ /goat/ ? $_ : () } 0..$#array)[0
    +];
    my $result3 = (grep { $array[$_][0] =~ /goat/ } 0..$#array)[0];