Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Optimise file line by line parsing, substitute SPLIT

by hbm (Hermit)
on Jun 03, 2013 at 14:40 UTC ( [id://1036779]=note: print w/replies, xml ) Need Help??


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);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1036779]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2026-03-06 15:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.