On 6 June 2012 00:07, 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 the documentation of (??{ ... }) says this should match.
"The result of evaluation is considered as a regular expression and
matched as if it were inserted instead of this construct."
Which says to me the above should match as /AA/i
Yves
--
perl -Mre=debug -e "/just|another|perl|hacker/"
Thread Previous
|
Thread Next