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

Re: Changes in m//m in 5.10

Thread Previous | Thread Next
December 22, 2007 06:35
Re: Changes in m//m in 5.10
Message ID:
On Dec 21, 2007 12:08 PM, demerphq <> 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About