sub countLines { my $filename = shift; open my $fh, '<', $filename or croak("failed to open '$filename' - $!"); my $count = 0; $count ++ while <$fh> return $count: } #### sub countLines { my $filename = shift; open my $fh, '<', $filename or croak("failed to open '$filename' - $!"); my $count = 0; local $/ = \2**26; ## 64MB raise or lower to taste $count += tr[\n][\n] while <$fh>; return $count: }