Keep It Simple, Stupid | |
PerlMonks |
Re^2: minimum, maximum and average of a list of numbers at the same timeby davorg (Chancellor) |
on Nov 10, 2005 at 12:21 UTC ( [id://507352]=note: print w/replies, xml ) | Need Help?? |
It does look temptingly simple doesn't it? But you'd be iterating across the list three times - which isn't very efficient. You only really need to iterate across it once. Something like this (off the top of my head and untested).
-- <http://dave.org.uk> "The first rule of Perl club is you do not talk about
Perl club."
In Section
Seekers of Perl Wisdom
|
|