in reply to Filter File Using HASH

A hash is a data-structure, like an array. The difference is that the lookup is not done via a numerical index, but with a key. Eg., if you create a hash like this:
%hash = ( "keys" => "value" );
You will be able to refer to "value" by saying:
print $hash{"value"};
In your case
print $wanted{"members.aol.com"};
will print "1". So if your regex matches, the matched part is used to make a lookup in your hash. If that returns true, the $line is printed.

You should definitly read perldata

Note: I am a bit surprised that you seem to understand a regex, but have problems with something very basic like hashes.

holli, regexed monk

Replies are listed 'Best First'.
Re^2: Filter File Using HASH
by pr19939 (Initiate) on Feb 01, 2005 at 13:02 UTC
    Hi, Thanks for you response.I will be precise in what i want to acheive.
    I have 10 log files of 35,000 lines each.I have looped through them and index searched them for .gif and .jpg extensions and have written them into a single log repository.This process takes 3 hours.
    I would like to know what would be best approach.Time frame is my main concern.
    Also the above-mentioned code did not work.
    Please help
    Thanks
      Can we have sample-data, please? Several significant lines are enough.

      holli, regexed monk