in reply to When should I use map, for?

Just for curiosity, I tried Algorithm::Loops as well. The results seem to indicate that if you want to go for readability you'd better use it, if you really need speed it's better to roll your own. Bewaring of the pitfalls.
#!/usr/bin/perl -w use strict; my @elem = (0..100_000); use Benchmark ':all'; use Algorithm::Loops 'Filter'; cmpthese ( 100, { 'mapn' => sub { my @e = @elem; @e = map { $_ if (s/0/./g || 1) } @e + }, 'for ' => sub { my @e = @elem; for (@e) { s/0/./g } }, 'mapc' => sub { my @e = map { $_ if (s/0/./g || 1) } @elem }, 'Filter' => sub { my @e = Filter { s/^\s+// } @elem }, }); __END__ ~/sviluppo/perl> ./loops.pl Rate Filter mapn mapc for Filter 4.00/s -- -1% -39% -53% mapn 4.06/s 1% -- -38% -52% mapc 6.57/s 64% 62% -- -23% for 8.54/s 113% 110% 30% --
Indeed, the implementation of Filter resembles that of for, but its generality has two drawbacks: Just my 2c.

Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')

Don't fool yourself.