develooper Front page | perl.perl5.porters | Postings from January 2010

Re: [perl #56444] (5.12 blocker) delayed interpolation of \N{...} charnames escapes in regexes in perl 5.9.x and later causes breakage

Thread Previous | Thread Next
From:
demerphq
Date:
January 27, 2010 11:44
Subject:
Re: [perl #56444] (5.12 blocker) delayed interpolation of \N{...} charnames escapes in regexes in perl 5.9.x and later causes breakage
Message ID:
9b18b3111001271143i6bcaacecs3f446e19c72dc0ad@mail.gmail.com
2010/1/27 demerphq <demerphq@gmail.com>:
> See then we would end up with bugs about how
>
> use charnames ':full';
> my $qr1= qr/\N{LATIN CAPITAL LETTER A}/;
> $^H{charnames} = sub{"f"};
> my $qr2= qr/\N{LATIN CAPITAL LETTER A}/;
> $^H{charnames} = sub{"foo"};
>
> my $x = 'foo';
> print "matched $1" if ($x=~/($qr1|$qr2|\N{LATIN CAPITAL LETTER A})/;

BTW, I should have said that this is hypothetical code. The point is
that two different charnames handlers could define different meanings
for any given charname. And then you need to somehow know which one it
was that the each qr// was defined under when embedding qr//. Etc etc.
It just seems to me to be a recipe for a mess. If we convert the
escape to something else that is not contextual we dont have to worry
about this at all. Anywhere. Which i think was the original plan.

cheers,
Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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