Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Faster Flat File

by wmono (Friar)
on Feb 03, 2002 at 04:15 UTC ( [id://143015]=note: print w/replies, xml ) Need Help??


in reply to Faster Flat File

Slurping an entire file into an array requires serious memory, if the file is of any decent size. Try this construct instead:
open (DATABASE, "file"); while ($rec = <DATABASE>) { # Do stuff } close DATABASE;
That'll at least keep your memory consumption down. If you were going into swap before, it might even make things run faster. Good luck!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-03-29 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found