in reply to Duplicate Results from Subroutine
Looks like they got you taken care of, so I thought I would pass a little tip about finding array size
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!
|
---|
In Section
Seekers of Perl Wisdom