in reply to Re: Simple things should be coded simply (Re: Idiomatic Array Index Search?)in thread Idiomatic Array Index Search?
sub get_index { my ($a, $e) = @_; my @idx = grep $a->[$_] eq $e, 0 .. $#$a; return wantarray ? @idx : $idx[0]; } [download]