Here's another argument against slurping: When you slurp a file all at
once, even if your program isn't using up much of the CPU, on many
machines it will slow down performance considerably if you slurp a large
file (large, of course, is still sometimes relative). If that is the
only thing you are running at the time, it may not make much of a
difference, but it is usually not a good idea to assume that.
The flip side of that argument. A quote from the earlier posted article:
"Another major win for slurping over line by line is speed. Perl's IO system (like many others) is slow. Calling <> for each line requires a check for the end of line, checks for EOF, copying a line, munging the internal handle structure, etc. Plenty of work for each line read in. On the other hand, slurping, if done correctly, will usually involve only one I/O call and no extra data copying. The same is true for writing files to disk, and we will cover that as well." --Uri Guttman
James
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>