First off: Are you sure the current record selector is '\n'. If this is running on a windows machine it is '\r\n' (or do I mean '\n\r'? who cares). In any case the safe way to get the new descriptor is to do (with local if required)
But actually I think you shoud be not monkeying with $/: at all and just skipping over # lines as you read them in, i.e.$/= ';'.$/
while (my $line = <DATA> ){ next if ($line =~ s/^#/); # skip comment lines print "Query: $line\n"; }
Dingus
In reply to Re: Record Separator affecting Regex
by dingus
in thread Record Separator affecting Regex
by Kozz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |