We don't bite newbies here... much | |
PerlMonks |
Re^3: regex issueby johngg (Canon) |
on Nov 11, 2010 at 11:51 UTC ( [id://870834]=note: print w/replies, xml ) | Need Help?? |
...or more legibly I think you might be obscuring the wood with a lot of trees there! Perhaps use of the -n switch would be applicable here, either in a script or as a one-liner.
The array slice method is, as you say, only suitable for small files whereas using -n when combined with last is more efficient when interested only in lines at the beginning of large files. The following examples were acting on a 2,000,000+ line log file.
I hope this is of interest. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|