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