in reply to How to find the index of an element in an array?
#!/usr/bin/perl -w use List::MoreUtils; my @foo=('a','b','c', 'd', 'e', 'f', 'g', 'h', 'i'); my $index = List::MoreUtils::first_index {$_ eq 'g'} @foo; print ("G's index = $index\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to find the index of an element in an array?
by bsb (Priest) on Sep 07, 2005 at 01:58 UTC |