in reply to help on how to create a hash look up table requested.
Erm, so just do it. You've said what you want, write the code.
my %hits; while( <> ) { my( $key ) = /HIT:\s+(\S+)/; $hits{ $key }++; } my @distinct = keys %hits;
Now you didn't say so, but if you want to preserve the order things appear in the input just push onto a list and use the hash to tell what you've already seen.
my @hits; my %seen; while( <> ) { my( $key ) = /HIT:\s+(\S+)/; next if $seen{ $key }++; push @hits, $key; }
|
|---|