This ends up actually taking longer to run than the original. I think that's because the s/// has to fly through the entire string of $material, where the loop version (original) stops (last out of loop) when it hits the match. (Not that I would really know for sure what I'm talking about.)
In reply to Re: Re: foreach (@array) s/x/y/ efficiency
by gryphon
in thread foreach (@array) s/x/y/ efficiency
by gryphon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |