laziness, impatience, and hubris | |
PerlMonks |
Re: Hash versus substitutation efficiency?by dragonchild (Archbishop) |
on Oct 11, 2004 at 19:03 UTC ( [id://398247]=note: print w/replies, xml ) | Need Help?? |
Your two options do different things. One searches a given document and the other modifies the given document.
For your first option, that's one of the better ways to do it. For your second option, I would do That uses much less memory. for will build a list in memory. each will iterate through that list without building it in memory first. Being right, does not endow the right to be rude; politeness costs nothing.
In Section
Seekers of Perl Wisdom
|
|