You asked about the difference between lists and arrays. Here's an example of map operating on lists, not arrays:
say for map { "$_ squared is " . $_ ** 2 } 1 .. 10;If an operator operates on lists, Perl's list context ensures that it can handle arrays. If an operator operates on arrays (push, splice), it won't necessarily operate on lists.
In reply to Re^4: Map Vs Foreach
by chromatic
in thread Map Vs Foreach
by perlCrazy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |