Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Duplicate Results from Subroutine

by dbuckhal (Friar)
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2018-06-19 17:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (114 votes). Check out past polls.

    Notices?