my $A; my $i; my @domain_A = (1..119); for (@domain_A) { vec($A,$_,1) = 1 } for ( $i = -100 ; $i <= 2000 ; $i++ ) { if (vec($A,$i,1)){ print "\t $i recognised as part of the 1st domain using the old method\n"; } }