hill has asked for the wisdom of the Perl Monks concerning the following question:
Still a duffer so this makes me fret.
I was slurping in a couple of similar sized files with something close to:
Basically concatenating the files. For an unknown reason (at least to me) the second file was about three times slower reading than the first. Reversing the order of the files exhibited the same behavior--the second file read took significantly longer. Things got better, and a LOT faster with:for $file (@list) {open INPUT, "$file" or die; @partial = <INPUT>; push @complete, @partial;}
Comments? Explanations? General ideas?for $file (@list) {open INPUT, "$file" or die; @complete = <INPUT>;}
In any case, many thanks for your attention.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: slow file slurping
by repellent (Priest) on May 01, 2009 at 00:57 UTC | |
|
Re: slow file slurping
by jwkrahn (Abbot) on May 01, 2009 at 01:12 UTC | |
|
Re: slow file slurping
by graff (Chancellor) on May 01, 2009 at 01:59 UTC | |
|
Re: slow file slurping
by lostjimmy (Chaplain) on May 01, 2009 at 00:18 UTC | |
|
Re: slow file slurping
by hill (Sexton) on May 01, 2009 at 11:22 UTC |