develooper Front page | perl.perl5.porters | Postings from February 2013

[perl #60726] Should invalid regex brace syntax be interpreted literally with no warning?

Thread Next
From:
James E Keenan via RT
Date:
February 24, 2013 23:05
Subject:
[perl #60726] Should invalid regex brace syntax be interpreted literally with no warning?
Message ID:
rt-3.6.HEAD-31961-1361747106-1330.60726-15-0@perl.org
On Mon Nov 24 01:07:16 2008, rafael wrote:
> 2008/11/21 james@netcraft.com (via RT) <perlbug-followup@perl.org>:
> > Incorrect brace notation causes the brace to be interpreted as a
> > literal string instead, with no warning generated.
> >
> > For example:
> > Perl -e 'use strict; use warnings; if ("111" =~ /\d{1.3}/) { print
> "true"; }'
> > perl -e 'use strict; use warnings; if ("1{1.3}" =~ /\d{1.3}/) {
> print "true"; }'
> > true
> >
> > Whilst I understand why the second line returns true, that
> interpretation of the
> > braces was probably a mistake and so I think that if the warnings
> pragma is in
> > use, this should generate a warning.
> 
> The line between situations where the warning is OK and where it is
> superfluous is not well-defined. For example, should /1{/ warn ?
> should /1{.}/ warn ? should /{}/ warn ? (In all those situations I'd
> favor the answer "no".) Aren't we going to introduce spurious and
> noisy warnings ?
> 

Rafael supplied the original poster with a response more than four years
ago, and there has been no further correspondence in this ticket.

I am closing this ticket.  Any discussion of new warnings should start
in a new RT.

Thank you very much.
Jim Keenan



---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=60726

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