in reply to Re: resetting a foreach loop!in thread resetting a foreach loop!
my($largest, $smallest) = (sort { $b <=> $a } @array)[0,-1];