JasonJ has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to parse a log file. I was working on using an array but now it looks like I should use a hash. What do you think? Other possibilities?
The input file has to be parsed with blank lines as a field separator. I will be searching it for 5 different strings, the results of the search will be put into 5 different log files. I will then send those log files to different people as email attachments.
Should I use an array, a hash, or is there another way to search through the file? Kind of like using grep with the blank line (or lines) as the field separator?
This node was helpful. http://www.perlmonks.org/?node_id=47236
This node made me rethink my approach. http://www.perlmonks.org/?node_id=610
Thanks!
Jason
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing log file with blank lines for the field separator
by apl (Monsignor) on May 05, 2008 at 18:52 UTC | |
|
Re: Parsing log file with blank lines for the field separator
by Narveson (Chaplain) on May 05, 2008 at 18:56 UTC | |
|
Re: Parsing log file with blank lines for the field separator
by mscharrer (Hermit) on May 05, 2008 at 19:31 UTC | |
by chromatic (Archbishop) on May 05, 2008 at 20:01 UTC | |
by JasonJ (Initiate) on May 06, 2008 at 18:19 UTC | |
by chromatic (Archbishop) on May 06, 2008 at 20:20 UTC | |
by JasonJ (Initiate) on May 06, 2008 at 15:51 UTC |