http://qs321.pair.com?node_id=143015


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!