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
In reply to Re: assigning the maximum of two numbers
by QM
in thread assigning the maximum of two numbers
by bageler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |