There's more than one way to do things | |
PerlMonks |
Square the array values.by Anonymous Monk |
on Mar 18, 2010 at 08:42 UTC ( [id://829348]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: Hi.. PERL Monks, I'm new to this forum, I have a requirement, I want to square the array values itself, ( without new array) Example: my @arr = qw( 1 2 3 4 5 6 7 8); I need to change the array like the following without new array. @arr = qw( 1 4 9 16 25 36 49 64); Thanks in advance...
Back to
Seekers of Perl Wisdom
|
|