in reply to
How to find the index of an element in an array?
try this code mate!!! my $a=0; my $b; foreach my $i (@foo){ if ($i eq 'g'){ $b=$a; } $a++; } $b will give you the index of element of 'g'
Comment on
Re: How to find the index of an element in an array?
In Section
Seekers of Perl Wisdom