On Sat, 28 Jan 2006 at 15:16 -0800, Brian Wisti <brianwisti at yahoo.com> wrote:
> You might try the List::Util module. It's core in 5.8.
>
> use List::Util qw(first);
> ...
> my $index = first { $_ == $test_value } @array;
$index is the element, not the index they were looking for.
perl -le ' use List::Util qw(first); print first { /c/ } ('a' .. 'z'); '
c