12
In Perl, if you have a loop like this:
foreach (@items) {
perform_action($_);
}
you can replace it with a call to map in void context:
map {
perform_action($_)
} @items;
Are there any advantages or disadvantages to doing to? Does it have a performance impact because Perl thinks it has to save the results? Does it improve/worsen readability?