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