http://www.perlmonks.org?node_id=829359


in reply to Square the array values.

Though it could be considered ugly, map can help you:

pajout@balvan:~$ perl -e 'my @a = (1,2,3); print join(",", map {$_*$_} + @a)."\n";' 1,4,9