in reply to Re^2: Parsing log file with blank lines for the field separator
in thread Parsing log file with blank lines for the field separator

chromatic,

I was able to use the hash you gave. Works perfectly. Could you please point me to a resource where I can learn more on hashes? I am not sure just what this code does and would like to be able to maintain it going forward.

Thanks!

Jason

  • Comment on Re^3: Parsing log file with blank lines for the field separator

Replies are listed 'Best First'.
Re^4: Parsing log file with blank lines for the field separator
by chromatic (Archbishop) on May 06, 2008 at 20:20 UTC

    perldoc perldata has a good section on hashes. Think of a hash like a dictionary or a phone book. You look up a word or a name, and you get back a definition or a phone number.

    With a hash, you use a string as the key (what you put in) and you get back a scalar as the value. In this case, the keys are filenames and the values are filehandles. There's a one-to-one mapping of keys to values.