in reply to grabbing info from log after key word
I might grep through the lines, looking only for 'Mozilla', splitting the results on Mozilla, and taking the length of the second element after the split. If you have many lines to process, this will take lots of memory, though.
You could do something more like this:
That's untested and rather generic, but it's fairly close.open(INPUT, "/path/$filename") or die "Can't open: $!"; while (<INPUT>) { if (/Mozilla/) { my $rest = (split(/Mozilla/, $_, 2))[1]; if (length($rest) > 100) { # tag this line somehow } } }
|
|---|