while ( <$in> ) { chomp; my ( $x, $y ) = split; last if $y <= $max->[ 1 ]; $max = [ $x, $y ]; }