my( $x_lo, $x_hi ) = ( -180, -170 ); my( $y_lo, $y_hi ) = ( -130, -120 ); my @matches; while (<>) { my( $x, $y ) = split; push @matches, [ $x, $y ] if $x >= $x_lo # slighly different syntax, && $x <= $x_hi # just to mix things up. :-) && $y >= $y_lo && $y <= $y_hi; } print scalar(@matches), " matches.\n";