Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: "Junkyard" Puzzle: Average of Numbers

by jmcnamara (Monsignor)
on May 14, 2001 at 02:04 UTC ( #80113=note: print w/replies, xml ) Need Help??

in reply to "Junkyard" Puzzle: Average of Numbers

This is 37 chars. I saw Abigail do something like this on clpmisc:
sub average1 { local$"="+";eval("@{$_[0]}")/@{$_[0]} }
This looks prettier when dealing with an ordinary list:
sub average2 { local$"="+";eval("@_")/@_ }
In which case this would be shorter:
sub average3 { eval(join"+",@_)/@_ }
The last one is the same as no_slogan's.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://80113]
[Corion]: marto: A rough week comes to an end?
Corion has to finish off some test tickets and hopefully close them. Also I have to prepare some information for the tax people on the weekend :-/
[marto]: it feels like 2 weeks :)
[Discipulus]: sane dots for your weekend marto!
[choroba]: My week was hectic as well, and so will be the next several ones...
[Corion]: Sane Dots Supplies - your brand manufacturer for satisfying experiences!

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2017-01-20 10:11 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (174 votes). Check out past polls.