Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: "Junkyard" Puzzle: Average of Numbers

by $code or die (Deacon)
on May 13, 2001 at 22:25 UTC ( #80079=note: print w/replies, xml ) Need Help??


in reply to "Junkyard" Puzzle: Average of Numbers

sub average { map{$_[1]+=$_}@{$_[0]};$_[1]/@{$_[0]} }
Works under strict and warnings. Although I am probably breaking your second rule (creating $_[1]).
$code or die


$ perldoc perldoc

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://80079]
help
Chatterbox?
[erix]: I'll keep that in mind (haven't read), buona notte :)
[Discipulus]: oh erix but is the fourth of cycle;read them in order
[erix]: hm, perhaps I can just read it here
Discipulus zzz...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2017-05-23 20:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?