I'm not sure if you're aware of it, but your code modifies @a since $_ in map and for aliases the current list element. If you don't want this, you'd have to localize$_ or to copy the current element to a new lexical variable.
Comment on Re: Basic list manipulation, and a bit of map() confusion...