Subject: | decodeURIComponent() influences references from a regexp |
Date: | Wed, 2 Sep 2009 21:50:56 +0200 |
To: | bug-URI-Escape-XS [...] rt.cpan.org |
From: | Martin Žember <zember [...] gmail.com> |
Hello,
this example triggers a bug when dealing references from RE:
#!/usr/bin/perl
use URI::Escape::XS;
$query = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
if( $query =~ /(b)/ ) {
$r = decodeURIComponent($1);
print "$r\n";
}
In my real app, it shortens submitted parameters.
Workaround: Use variables instead of references (e.g. my $ref = $1;)
Used on debian, perl, v5.10.0 built for i486-linux-gnu-thread-multi, XS 0.5.
Martin Žember