![]() |
|
No such thing as a small change | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
I would localise the $/ variable and set it to the
string that splits your log entries "*****\n*****". If you
then read from the file in a scalar context it will give you
one complete log entry.
You then need to remove the string you split the file on ("*****\n*****") and split the remainder on a new line "\n". Place the result of this split in an array. If the last element of this array starts with "Server Closed", then you have a complete log entry.
This leaves the string "*****" on the front of the first log entry. You can then do whatever processing you need on the logs either one complete log at a time, or instead of assigning the split to @split_log, create an anonymous array and push that onto @split_log. This will let you defer your processing to the end. Nuance
In reply to RE: Multiple session log extraction from a single file problem
by nuance
|
|