Skip Menu |

This queue is for tickets about the Regexp-DefaultFlags CPAN distribution.

Report information
The Basics
Id: 21635
Status: open
Priority: 0/
Queue: Regexp-DefaultFlags

People
Owner: Nobody in particular
Requestors: tikitu [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.01
Fixed in: (no value)



Subject: match vars empty when vars used in regexp
Under Regexp::DefaultFlags, if you include a var in a capture group of a regexp it gets matched correctly but the match var doesn't contain the contents afterwards. *But*, a capture group containing the var *and some other material* starts working as expected again. <boggles> Some details: Version 0.01 of Regexp::DefaultFlags released September 28, 2004. perl -v: This is perl, v5.8.7 built for i486-linux-gnu-thread-multi (with 1 registered patch, see perl -V for more detail) perl -V: Locally applied patches: SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962 uname -a: Linux delilah 2.6.15-27-386 #1 PREEMPT Sat Sep 16 01:51:59 UTC 2006 i686 GNU/Linux (God, I just looked at the code, this bug report is longer than the module. What can possibly be going wrong there?!) Tiny test file follows: # demonstrates that Regexp::DefaultFlags != /×ms my $string = "ef"; my $regexp = 'e'; $string =~ m/(($regexp)f)/xms; my $expected_ef = $1; # $1 eq 'ef' my $expected_e = $2; # $2 eq 'e' use Regexp::DefaultFlags; if ($string =~ m/(($regexp)f)/) { # it matches, and... print "matched as expected, and...\n"; if ($expected_ef eq $1) { # it is, but... print "'ef' captured ok, but...\n"; } else { print "expected [$expected_ef], got [$1]\n"; } if($expected_e eq $2) { # it isn't! print "sorry, my mistake, no problem!\n"; } else { print "expected [$regexp], got [$2]\n"; # $1 eq '' } } else { print "didn't match at all\n"; # doesn't happen }
A somewhat different example of the same problem. perl -v: This is perl, v5.8.8 built for i386-linux-thread-multi rpm: FC 5 perl-5.8.8-10 uname -a: Linux mtranch.mtranch.com 2.6.18-1.2869.fc6 #1 SMP Wed Dec 20 14:51:46 EST 2006 i686 athlon i386 GNU/Linux #! /usr/bin/perl $test = 'ABCD'; $re = qr{A}; $t = $test; $t =~ s{($re)}{a$1}; print "$t\n"; use Regexp::DefaultFlags; $re = qr{A}; $t = $test; $t =~ s{($re)}{a$1}; print "$t\n"; %perl df.pl aABCD aBCD which is a long way of saying that after Regexp::DefaultFlags is loaded, $1 returns NULL.