develooper Front page | perl.perl5.porters | Postings from June 2012

Fwd: [perl #6011] /imsx not visible inside (??{})

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
June 5, 2012 15:24
Subject:
Fwd: [perl #6011] /imsx not visible inside (??{})
Message ID:
CAHhgV8iVqVoXWKQhn3egDxU3aDLVMmKXmAmyfx7OoX0rw+b6TQ@mail.gmail.com
On Wed, Jun 6, 2012 at 12:20 AM, Leon Timmermans <fawaka@gmail.com> wrote:
> On Wed, Jun 6, 2012 at 12:07 AM, Dave Mitchell <davem@iabyn.com> wrote:
>> p5pers:
>> this rather old ticket from Rick Delaney points out that in the following:
>>
>>    $some_pattern_string = 'A';
>>    "aa" =~ /A(??{ $some_pattern_string })/i
>>
>> the returned pattern string is compiled *without* /i (or other such
>> flags), and thus fails to match.
>>
>> The question is, whether this behaviour is right,and the docs need
>> clarifying, or whether it should be "fixed".
>>
>> I lean towards not-a-bug and fix the docs, by analogy with
>>
>>    my $some_pattern = qr/A/; # this doesn't use /i
>>    "aa" =~ /A(??{ $some_pattern })/i
>>
>> which (correctly IMHO) fails to match.
>
> I think /(??{ $some_pattern_string })/ should do the same as
> /$some_pattern_string/, so I would see this as a bug.
>
> Leon

And now to the correct address…

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