in reply to assigning the maximum of two numbers
I prefer thissub assignmax5 { @a = sort@_; pop @a; }
It's immediately obvious, and easy to maintain.sub assignmax5 { return (sort @_)[-1]; }
Update: strike
-QM
--
Quantum Mechanics: The dreams stuff is made of
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: assigning the maximum of two numbers
by Roy Johnson (Monsignor) on Nov 03, 2005 at 19:10 UTC | |
|
Re^2: assigning the maximum of two numbers
by Tanktalus (Canon) on Nov 03, 2005 at 19:25 UTC |