in reply to Count number of lines in a text file

different approach using Tie::File (should also work w/large files):
perl -MTie::File -MFcntl=O_RDONLY -le 'tie @array, "Tie::File", shift, + mode => O_RDONLY or die $!; print scalar @array' /etc/hosts
.. and of course there's wc on *nix or from ppt