in reply to side effects of map

I don't know what value this is, but this behavior isn't limited to map. If you substitute your map line with
foreach my $a (@$aref) { };
The same thing will occur. The only thing that comes to mind as far as why this would happen is that two things are happening in both cases.

1) You're derefrencing the scalar as an array.
2) You're using a function that can modify the contents of that array.

In your other example, @$aref isn't modifiable. I personally wouldn't consider this a bug in perl. If you're going to access a refrence as an array, why is there a problem if it is an array?

Rich