in reply to Square the array values.
I'd just:
my @arr = map {$_ * $_} qw( 1 2 3 4 5 6 7 8); [download]
or if the array already exists:
$_ *= $_ for @arr; [download]