in reply to How To Count Lines In File?

In the spirit of TIMTOWTDI
perl -e 'print @{[<>]}.$/' some_file_here

HTH

_________
broquaint

Replies are listed 'Best First'.
Re^2: How To Count Lines In File?
by Aristotle (Chancellor) on Jan 27, 2003 at 16:07 UTC
    You slurp the file though - and you still pay the read-line-by-line penalty. Here's one that slurps as well but counts using tr.
    $ perl -lp0777e'$_=tr/\n//' foo

    Makeshifts last the longest.