in reply to Duplicate Results from Subroutine
You can get the array length by this:sub avg { my $len1 = $#numlist + 1; return total(@numlist) / $len1; }
... which is the scalar value of your array, which is the size.my $len1 = @numlist;
Enjoy Learning Perl!
|
|---|