use strict; use Test::More q(no_plan); my @z = qw(1 3 27 38); my $x = shift(); my $y = shift(); my @test = ( [qw( 4 5) => 1], [qw( 0 -1) => 1], [qw(100 100) => 1], [qw( 10 27) => 1], [qw( 3 27) => 0], [qw( 0 100) => 0], ); sub bool { not not shift } for(@test) { my ($x, $y, $works) = @$_; is( # 1 2 3 #23456789012345678901234567890 ((grep$x<=$_,@z)==grep$y<=$_,@z), bool($works), "x=$x y=$y" ); } __END__ ok 1 - x=4 y=5 ok 2 - x=0 y=-1 ok 3 - x=100 y=100 ok 4 - x=10 y=27 ok 5 - x=3 y=27 ok 6 - x=0 y=100 1..6