Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Duplicate Results from Subroutine

by dbuckhal (Hermit)
on May 24, 2013 at 06:03 UTC ( #1035069=note: print w/replies, xml ) Need Help??


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
sub avg { my $len1 = $#numlist + 1; return total(@numlist) / $len1; }
You can get the array length by this:
my $len1 = @numlist;
... which is the scalar value of your array, which is the size.

Enjoy Learning Perl!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1035069]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2019-12-11 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?