Foreach is faster than map if you're modifying in place. If you're using foreach to push into an array, like what's happening here, then map is going to be faster. (which is why there's the recommendation not to use map if you're not doing anything with the list generated -- you might as well have just done foreach).
This is no longer the case for recent versions of perl.
Now map has been optimized in void context, so if you
don't do anything with the return values, it doesn't bother generating them.
In theory, the only difference between map and for/foreach
now is a matter of taste/style. (I say "in theory", because I haven't benchmarked it, and sometimes the perl porters *think* they've done, isn't quite what they've done.)