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

Re: qr stringification: why are xism always present? I'm worried about backward compatibility

Thread Previous | Thread Next
From:
Ævar Arnfjörð Bjarmason
Date:
August 1, 2010 12:27
Subject:
Re: qr stringification: why are xism always present? I'm worried about backward compatibility
Message ID:
AANLkTimg3H2yMnyF5Vp3X18smXQaxRm_YWH2jFa=BJRq@mail.gmail.com
On Sun, Aug 1, 2010 at 19:02, Ben Morrow <ben@morrow.me.uk> wrote:

> The reason is so that interpolation under different flags works
> properly. Currently, if I have
>
>    my $rx = qr/f./s;
>
> is stringifies to (?s-xim:f.), which means that when I interpolate it
> into a pattern with different flags
>
>    "AFx" =~ /a$rx/i;

Except in that case we could detect it because the // operator has
access to the original regex object through $rx.

But the equivalent example where $rx has been stringified somewhere
along the way would be applicable.

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