The second one returns that last index though (because if there are duplicates, each new occurence overwrites the previous one). This is not an issue of course if the values are unique, in which case it might make sense to store them in a hash in the first place.
In reply to Re^2: grep surprise
by Eily
in thread grep surprise
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |