in reply to Re: grep surprise
in thread grep surprise

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.