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