|
|
| Think about Loose Coupling | |
| PerlMonks |
Re: Re: Re: Efficient processing of large directoryby dragonchild (Archbishop) |
| on Oct 02, 2003 at 16:54 UTC ( #295973=note: print w/ replies, xml ) | Need Help?? |
|
It has to do with how foreach (and for, which is an exact synonym) works. foreach will construct the entire list, then iterate through it. This can be very memory-intensive, which will slow the processing speed (due to cache misses and virtual memory issues.) A nearly exact rewrite of foreach in terms of while would look something like:
------ The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6 Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||