more useful options | |
PerlMonks |
Re: Re: Looking for a better way to get the number of lines in a file...by gbarr (Monk) |
on Dec 10, 2001 at 22:20 UTC ( [id://130731]=note: print w/replies, xml ) | Need Help?? |
Reading the file line-by-line is not going to be the most efficient way, esp. if the file is large. Instead you could read the file in blocks and count the newline characters
This example reads in chunks of 100K.
In Section
Seekers of Perl Wisdom
|
|