This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ext/B/t/OptreeCheck.pm: Escape literal pattern '{'
authorKarl Williamson <khw@cpan.org>
Fri, 8 Apr 2016 18:07:05 +0000 (12:07 -0600)
committerKarl Williamson <khw@cpan.org>
Mon, 9 May 2016 17:13:49 +0000 (11:13 -0600)
The deprecated warnings were getting suppressed, but literal '{' in
patterns needs to be escaped.

ext/B/t/OptreeCheck.pm

index a099a97..3ae1930 100644 (file)
@@ -5,7 +5,7 @@ use warnings;
 use vars qw($TODO $Level $using_open);
 require "test.pl";
 
-our $VERSION = '0.13';
+our $VERSION = '0.14';
 
 # now export checkOptree, and those test.pl functions used by tests
 our @EXPORT = qw( checkOptree plan skip skip_all pass is like unlike
@@ -703,12 +703,12 @@ sub mkCheckRex {
                 .*                     # all sorts of things follow it
                 v                      # The opening v
                )
-               (?:(:>,<,%,\\{)         # hints when open.pm is in force
+               (?:(:>,<,%,\\\{)                # hints when open.pm is in force
                   |(:>,<,%))           # (two variations)
                (\ ->(?:-|[0-9a-z]+))?
                $
               ]
-       [$1 . ($2 && ':{') . $4]xegm;   # change to the hints without open.pm
+        [$1 . ($2 && ':\{') . $4]xegm; # change to the hints without open.pm
     }