Test4.pm:
=====
package Test4;
my $regex = qr/\w+/;
sub test {
print "$regex\n";
print ("word" =~ m/^$regex$/o ? "Match\n" : "No match\n");
}
1
=====
test4.pl:
=====
use Test4;
&Test4::test();
=====
Expected output:
$ perl test4.pl
(?-xism:\w+)
Match
With B::C, regex match fails:
$ perlcc -o test4 test4.pl
$ ./test4
Regexp=SCALAR(0x804c5c0)
No match
--
Heinz Knutzen