in reply to Optimise file line by line parsing, substitute SPLIT
For the little it's worth here, I'd take advantage of $. and $_. Minimize what you are doing millions of times; and then yes, run a handful in parallel.
open(my $fh, '<', $file) or die("Can not open file $file to read!\n"); while(<$fh>) { chomp; my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k) = split("\t", $_, 11); # do something real } print "\n# of lines: $.\n"; close($fh);
|
---|