in reply to Can i do math with the elements of an array?
Yes.
my @z = ( 30, 18, 54, 24, 88 ); my $sum = $z[1] + $z[3]; print $sum, "\n"; # Prints "42"
|
---|
In Section
Seekers of Perl Wisdom