in reply to Parse a huge file and match the lines against a hash entry

If you have to find the key in your hash given a value, then perhaps your hash is the wrong way around.

As long as your values are valid as hash keys, you can easily swap keys and values with

my %reversed = reverse %hash;

after which you can find the key corresponding to a value in your original hash, as follows:

my $value = 'whatever'; my $key = $reversed{$value};