my @ok=(0,0,0,1,0,1,0,1); # 0 1 2 3 4 5 6 7 my $x = 4; my $y = 5; if($ok[$x]){print "$x is ok\n";} if($ok[$y]){print "$y is ok\n";}