good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: How do I find the total number of lines in a file?by nuance (Hermit) |
on Aug 17, 2000 at 19:42 UTC ( [id://28306]=note: print w/replies, xml ) | Need Help?? |
The variable $. contains the line number of the last file read from, so:
note: If you're using <> to iterate over @ARGV then the line numbers don't reset over the files. So on if you were reading five ten line files on line five of file three, $. will contain 25. See perldoc perlvar for more info Editor's Note:
In Section
Seekers of Perl Wisdom
|
|