Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: How to split file for threading?

by diyaz (Beadle)
on Jun 23, 2015 at 14:47 UTC ( [id://1131647]=note: print w/replies, xml ) Need Help??


in reply to Re: How to split file for threading?
in thread How to split file for threading?

It doesn't take hours only maybe 10-15 minutes. I was thinking this would be an easy example of learning threading. I did see the previous posts. Are you implying I should use Bio::Seq to thread?

Replies are listed 'Best First'.
Re^3: How to split file for threading?
by stevieb (Canon) on Jun 23, 2015 at 15:01 UTC

    No. Anonymonk is suggesting not using for() to read a file.

    Use while (my $line = <INFILE>){ ... instead.

      i see, but why is that better? Are they not equivalent? one slurps first then processes whereas while reads and process one at a time?
        one slurps first

        How much memory do you have? And how big is the file?


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
        I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-03-28 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found