Subject: | Documentation of 'map' |
It appears that alias cannot be used with map:
my @a = ([1], [2], [3]);
alias my @b = map { $_->[0] } @a;
++$_->[0] foreach @b;
say $_->[0] foreach @a;
The map makes sure you get a copy not an alias. And I don't think you can work around it by putting alias inside the map block. You have to use foreach instead:
my @b; alias push @b, $_->[0] foreach @a;
If this is correct, it would be useful to note it in the documentation. (Also the behaviour of grep)