http://qs1969.pair.com?node_id=560173


in reply to Range Issue with RegEx

As above, I'd recommend using number equality instead of regular expressions if that's what you really mean. The range operator and grep are handy for this, like in this (untested) snippet:

while (<DATA>){ chomp; $tag = $_; if (grep {$tag == $_} 500..503,531,532) { print "$tag\n"; } }
(Remember that the $_ in the grep expression is not the same as the $_ in the while loop. More info at grep.)