develooper Front page | perl.perl5.porters | Postings from May 2016

[perl #128213] No deprecation warning on literal left curly bracketin /.{/ etc

Thread Previous | Thread Next
From:
Tom Wyant via RT
Date:
May 23, 2016 10:52
Subject:
[perl #128213] No deprecation warning on literal left curly bracketin /.{/ etc
Message ID:
rt-4.0.18-6108-1464000713-1074.128213-15-0@perl.org
FWIW:

$ perl -c -Mre=debug -e '/\d{/'
Compiling REx "\d{"
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\d{ <-- HERE / at -e line 1.
Final program:
   1: POSIXU[\d] (2)
   2: EXACT <{> (4)
   4: END (0)
anchored "{" at 1 (checking anchored) stclass POSIXU[\d] minlen 2 
-e syntax OK
Freeing REx: "\d{"

and similarly for \D, \s, \S, \v, \V, \N, \h. Which is why I expected a warning (5.24.0) or error (5.25.1) on /.{/.

On the other hand, the comment seems to say none of these should warn. The 'Quantifiers' section of the Perl 5.24.0 and 5.25.1 perlre seems to say that all left curlys not part of a quantifier are literals and deprecated, but omits the "first character in the pattern" exception that appears in the 5.25.1 perldelta. None of which seems to help, thoug. :-(

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

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