http://www.perlmonks.org?node_id=556183


in reply to Re: improving the efficiency of a script
in thread improving the efficiency of a script

For a modest size file (1 M words x about 6 characters = 6 MB) loading it all into memory is likely to be much faster than going out to the file system twice. On the other hand the file system may cache it for you - ya just gotta suck it and see. Even then it may be different tomorrow than it is today.


DWIM is Perl's answer to Gödel
  • Comment on Re^2: improving the efficiency of a script