⭐ in reply to How do I find the index of a specific array value?
This is a win, for larger arrays, if you need to do multiple/many lookups while the array remains static.my @array = qw( your array here ); my $search = "array"; my %index; @index{@array} = (0..$#array); my $index = $index{$search}; print $index, "\n";
|
|---|