In Perl, is it appropriate to use map in void context instead of a foreach loop?

Starting from Perl 5.8.1 map in void context is not expensive:

map in void context is no longer
expensive. map is now context aware,
and will not construct a list if
called in void context.

But the postfix form of for may be more readable:

perform_action($_) for @items;

Leave a Comment