I'd just:
my @arr = map {$_ * $_} qw( 1 2 3 4 5 6 7 8);
or if the array already exists:
$_ *= $_ for @arr;
In reply to Re: Square the array values.
by GrandFather
in thread Square the array values.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |