in reply to Re: Looking for a better way to get the number of lines in a file...
in thread Looking for a better way to get the number of lines in a file...
What I like about this is that you aren't storing anything in memory - so this should wade through a 2GB file (as mentioned fearfully later in this thread) fairly quickly.#!/usr/bin/perl open ( FH,'data' ) or die ( "data: $!\n" ); while( <FH> ) { if ( eof ( FH ) ) { print $. } }
blyman
setenv EXINIT 'set noai ts=2'