I quess what i'm trying to figure out is how to make my Java record count program work as fast as an equivalent PERL program. This Perl program must be avoiding the loading of the record somehow maybe? because it runs at least 2X faster than the JAVA program and i'd prefer to use JAVA for this process!
#!/usr/bin/perl
$filename = $ARGV[0];
#open the list of files
open (FILE_IN,$filename) || die ("Open Failed1: $!\n");
while (defined($infile=<FILE_IN>
) {
print "$infile\n";
chomp ($infile);
open (IN,$infile) || die ("Open Failed2: $!\n");
while (defined($line=<IN>
) {
$nlines++; # counts the lines
}
}
close IN;
close FILE_IN;
print "rows: $nlines\n";