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

Re: [perl #62056] Variable expansion in same regex as \N{} escaperesults in compilation error.

Thread Previous | Thread Next
From:
Moritz Lenz
Date:
January 8, 2009 11:47
Subject:
Re: [perl #62056] Variable expansion in same regex as \N{} escaperesults in compilation error.
Message ID:
496658A4.1060509@casella.verplant.org
Elliot Shank wrote:
> # New Ticket Created by  Elliot Shank 
> # Please include the string:  [perl #62056]
> # in the subject line of all future correspondence about this issue. 
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=62056 >
> 
> 
> This is a bug report for perl from perl@galumph.com,
> generated with the help of perlbug 1.36 running under perl 5.10.0.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> Putting a variable expansion into a regex with a \N{} escape
> results in a compilation error in 5.10.0.  For example, the
> following program compiles:
> 
>     #!/usr/bin/env perl
>     use charnames ':full';
>     m/\N{START OF HEADING}/
> 
> However, this
> 
>     #!/usr/bin/env perl
>     use charnames ':full';
>     m/$x\N{START OF HEADING}/
> 
> results in
> 
>     Constant(\N{START OF HEADING}) unknown: (possibly a missing
>     "use charnames ...") in regex;

This worked in perl-5.8.8, and fails in perl-5.10.0.
So I bisected it, and this is what git-bisect says is the offending commit:

fc8cd66c26827f6c2ee1aa00ab2d3b3c320a4a28 is first bad commit
commit fc8cd66c26827f6c2ee1aa00ab2d3b3c320a4a28
Author: Yves Orton <demerphq@gmail.com>
Date:   Tue Sep 19 03:37:19 2006 +0200

    Re: \N{...} in regular expression [PATCH]
    Message-ID:
<9b18b3110609181637m796d6c16o1b2741edc5f09eb2@mail.gmail.com>

    p4raw-id: //depot/perl@28868

Cheers,
Moritz

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