Yes--well done!
...I am not sure if it's the correct way...
If I may, however, offer the following for you to consider:
#!/usr/bin/perl use strict; use warnings; my $sum = 0; my @nums = (); push( @nums, ( 4, 8 ) ); $sum += $_ for @nums; my $size = @nums; my $average = $sum / $size; print "$average";
In reply to Re^3: Help with arrays
by Kenosis
in thread Help with arrays
by perlguru22
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |