in reply to How to find the index of an element in an array?
#!/usr/bin/perl -w my @foo=('a','b','c', 'd', 'e', 'f', 'g', 'h', 'i'); my %bar; my $i = 0; $bar{$_} = $i++ for (@foo); print ("G's index = $bar{'g'}\n"); __END__ G's index = 6
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to find the index of an element in an array?
by knsridhar (Scribe) on Sep 06, 2005 at 06:35 UTC | |
by sk (Curate) on Sep 06, 2005 at 06:58 UTC |