in reply to Re^2: resetting a foreach loop!
in thread resetting a foreach loop!
You're right. I should have pointed the dangers of my assumptions in my post. I hadn't even thought of just using the 0th element of the array twice to initialize the largest/smallest -- but that's the best choice for the single-loop version. Thanks.
TIMTOWTDI: with perl 5.24 and newer, you could set those to my ($largest, $smallest) = (-POSIX::Inf, +POSIX::Inf): nothing's bigger or smaller than Infinity, after all. :-)
|
|---|