While answering this question, I came to realize that I was not sure whether Perl\'s map
can be considered a loop or not?
On one hand, it quacks/walks l
No, it is not a loop, from my perspective.
Characteristic of (perl) loops is that they can be broken out of (last
) or resumed (next
, redo
). map
cannot:
map { last } qw(stack overflow); # ERROR! Can't "last" outside a loop block
The error message suggests that perl itself doesn't consider the evaluated block a loop block.