develooper Front page | perl.perl5.porters | Postings from July 2008

Re: [perl #56444] Perl 5.10 breaks \N{} in regex interpolated inside regex (with charnames)

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
July 7, 2008 08:57
Subject:
Re: [perl #56444] Perl 5.10 breaks \N{} in regex interpolated inside regex (with charnames)
Message ID:
b77c1dce0807070854v5eb6688aj9a5fb4e70528591c@mail.gmail.com
2008/6/29 via RT Chris Pirazzi <perlbug-followup@perl.org>:
> Perl 5.10 (ActiveState ActivePerl Build 1003) breaks the following
> script, as compared with Perl 5.8.8 (ActiveState ActivePerl Build
> 822):
>
> use utf8;
> use strict;
> use English qw( -no_match_vars );
> use charnames ':full';
> my $r1 = qr/\N{THAI CHARACTER SARA I}/;
> my $s1 = "foo";
> $s1 =~ /$r1+/;
>
> The problem is that the last line errs with:
>
> Constant(\N{THAI CHARACTER SARA I}) unknown: (possibly a missing "use
> charnames...") in regex; marked by <-- HERE in m/(?-xism:\N{THAI
> CHARACTER SARA I} <-- HERE )+/ at t.pl line 7.
>
> Note that I did use 'charnames' and that the \N{} DOES work in the first regex.
> The err is in line 7, the last line, where the correctly compiled
> regex gets re-interpolated.

Interestingly, if we wrap the code from "my $r1" to the end in an
eval(""), then it compiles correctly. So that's some kind of
time-of-loading problem.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About