use List::Util qw(first); my @array = qw( Apples Oranges Brains Toes Kiwi); my $search = "Toes"; my $index = first { $array[$_] eq $search } 0 .. $#array; print "index of $search = $index\n";
In reply to Re: How do I find the index of a specific array value?
by myuserid7
in thread How do I find the index of a specific array value?
by BigVic
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |