Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Faster Flat File

by wmono (Friar)
on Feb 03, 2002 at 04:15 UTC ( #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? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2023-06-07 09:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (29 votes). Check out past polls.

    Notices?