You seem to be processing files, those operations are in general magnitudes slower than any loop constructs.
For instance slurping instead of iterating can make a huge difference.
So I hope you are not comparing apples with oranges.
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
In reply to Re: Speed comparison of foreach vs grep + map
by LanX
in thread Speed comparison of foreach vs grep + map
by mldvx4
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |