[] does not do what you think it does in a regexp. I would do a sub to do what you want done.
# Zone 8
my $z8 = "10-374,376-379,382-385,388-499,530-534,541-543,618,619,700-7
+04,707-709";
my $num = "375";
print "Found it!\n" if in_range($z8, $num); #$num =~/[$z8]/;
sub in_range{
my $numbers = shift;
my $num = shift;
my @ranges = split ',', $numbers;
foreach my $r (@ranges){
if (my ($small, $big) = $r =~ /^(\d+)-(\d+)$/){
return 1 if $small <= $num and $big >= $num;
}
elsif( my ($n) = $r =~ /^(\d+)$/){
return 1 if $n == $num;
}
else{
die 'Oh noo:-(';
}
}
return 0;
}
Update: Fixed bugs