in reply to Re^2: grep surprise
in thread grep surprise

Since you are testing the case where all entries are unique, you may want to add benchmarks for hash lookups.

Actually two: there is no doubt that a lookup is way faster, the essential question is if the initialization of the hash needs to be included.

In the later case I'd prefer a hash slice then.

@lookup{@array} = (0.. $#array);

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice