develooper Front page | perl.perl5.porters | Postings from December 2007

Re: Changes in m//m in 5.10

Thread Previous | Thread Next
From:
=?UTF-8?Q?=C3=86var_Arnfj=C3=B6r=C3=B0_Bjarmason?=
Date:
December 22, 2007 06:35
Subject:
Re: Changes in m//m in 5.10
Message ID:
51dd1af80712220635o6179d7c2v8e9b2b520f523eb@mail.gmail.com
On Dec 21, 2007 12:08 PM, demerphq <demerphq@gmail.com> wrote:
> No it wont actually. The warning would only be raised when the $qr
> variable is the only thing in the pattern. The diagnostics should read
> (added an 'only'):
>
> +(W regexp) Your pattern contains only a variable containing a precompiled
> +regular expression pattern whose behavior will not be changed by the
> +pattern modifiers provided.
>
> $qr=/^foo/;
> $x=~/$qr/m; # warns;
> $x=~/$qr|foo/m; #does not warn
> $x=~/$qr/x;  # does not warn (/x doesnt change match semantics)

In the current implementation yes, but we might potentially want to
warn in the future on useless modifiers in general, eg:

$x =~ /(?-msix:^foo)/msi;

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