my @item = qw(foo bar baz qux); my %lookup = (); @lookup{@item} = (0..$#item); # lookup stuff my $index = $lookup{baz}; print $item[$index], "\n";
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to (jeffa) Re: Determing the indice of an array
by jeffa
in thread Determing the indice of an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |