Perl-Sensitive Sunglasses | |
PerlMonks |
Re: DateTime::Format::Flexible; for Log Parse with multiple formatted linesby 1nickt (Canon) |
on Mar 23, 2017 at 19:12 UTC ( [id://1185665]=note: print w/replies, xml ) | Need Help?? |
It appears that you are not only reading in all the lines of the file at once, but then combining them all into one string. This is probably not a scalable solution. Instead consider using while to go through the lines one at a time, processing the text and extracting the data you need in a loop. The other thing I saw at a glance is that you are trying to use $0 as a regex capture, which will not do what you expect. Edit: Also please place your sample input into <code></code> tags, as it's not rendering accurately at the moment and can't be used for testing. Please consider sharing an SSCCE which in this case would include a couple of sample lines in the __DATA__ section, the regexp you're using to extract the fields, and then the date handling code ... all in one script of 20 - 30 lines.
The way forward always starts with a minimal test.
In Section
Seekers of Perl Wisdom
|
|