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

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

Thread Previous | Thread Next
From:
Zefram
Date:
August 19, 2010 08:06
Subject:
Re: qr stringification: why are xism always present? I'm worriedabout backward compatibility
Message ID:
20100819150548.GI30465@lake.fysh.org
Abigail wrote:
>It does. It tells me that pattern following the : neither enables, nor
>disables /p. Whether /p is in effect is inherited from the enclosing
>pattern.

Right.  Which means you don't know whether /p is enabled within that
group.  Contrary to your statement that it tells you exactly which flags
are enabled.

(As Avar pointed out, /p isn't a brilliant example of this issue, because
it applies to an entire pattern match operation rather than to part of
a pattern.  But it's the only new flag that we've actually got, and perl
*does* allow it to be specified in (?:) as if it had scoped effect.)

>                                If he comes with '(?~-xm:PATTERN)', I'll
>have to reply "well, that depends on the version of Perl you're running".

You can't have a "-" in the (?^:) flag set.  If you see (?^si:PATTERN),
this tells you quite precisely that the /s and /i flags are on *and all
other flags are off*.  So /p is either off or non-existent, depending
on the perl version, either situation having the same effect.

-zefram

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