Subject: | regex in comments |
Given these two source files
------ myfilter.pm -------------
package myfilter;
use Filter::Simple;
FILTER_ONLY quotelike => sub {
print "[$_]\n";
};
------ test-filter.pl ----------
use myfilter;
# http://xsgiasdfasdf.com
my $x = "asdf";
print $Filter::Simple::VERSION . ' ' . $Text::Balanced::VERSION;
--------------------------------
the following output is generated upon running test-filter.pl (under Perl 5.8.0/WinXP with the latest relavent modules):
--------------------------------
[//xsgi]
["asdf"]
[' ']
0.79 1.95
--------------------------------
So, the URL inside the Perl comment is being interpreted as a regex. This error was noticed when using Filter::Simple for the (atypical?) purpose of extracting all string literals from a Perl source file.