> After I sent this I had a flash of enlightenment: > > $max = (sort {$a <=> $b} @_)[-1]; > > May be slower, though, I don't know.
How many times have I seen this? I mean, I've seen this construct many times, and the question deserves a place in the Perl FAQ. Please refer back to: http://archive.develooper.com/beginners%40perl.org/msg22716.html so that nobody has to duplicate effort in answering this... we even did a discussion of the benefit of using sort - and I'm sure somebody did benchmarks in an even earlier thread on this very topic. Jonathan Paton __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]