in reply to placing values into bins

So, if the value of x is between 123 and 124 and value of y is between 456 and 457 increment the count by so.
Where do these constraints come from? What do you want to do if the values are exactly 123 and 457? Do you mean something like this?
my $count = 0; while(<STDIN>) { chomp; my ($x,$y) = split; if ($x > 123 and $x < 124 and $y > 456 and $y < 457) { $count++; } } print "123-124 456-457 $count\n";