Excellent post, but I feel like I need to write in defense of the "first approach." Not only is it "easier to follow, if you're new to Perl," but I think it's easier to follow even if you're not new to Perl. In other words, it's simply clearer code.
I say this because map and grep have fairly common, specific uses. Nearly anyone reading the code will immediately recognize grep as filtering the results. Shoving that logic into the map block fails to take advantage of that quick recognition. It may not seem like a lot, but these things add up.
In reply to Re^2: map weirdness
by revdiablo
in thread map weirdness
by insaniac
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |