Subject: | Unescaped left brace in regex is deprecated (Perl 5.17.4) |
Starting with Perl 5.17.0, AppConfig::File emits the warning
Unescaped left brace in regex is deprecated, passed through in regex;
marked by
<-- HERE in m/
( \$ { <-- HERE (\w+) } )
/ at
/Users/tom/.cpan/build/AppConfig-1.66-cneS6a/blib/lib/AppConfig
/File.pm line 453.
Now, the left brace being complained about _is_ escaped in the source.
But https://rt.perl.org/rt3//Public/Bug/Display.html?id=113094 makes it
sound like back slash escaping of the character used as a regular
expression delimiter is a dicey proposition.
Because of this I have developed the attached patch, which uses a
single-character character class instead. This passes tests (without the
warning) under the latest version of every production Perl since 5.6, as
well as under 5.17.4.
I have called this unimportant because at this point it is only a
warning under a development version of Perl.
Subject: | AppConfig-File.patch |
--- lib/AppConfig/File.old 2007-05-30 07:24:09.000000000 -0400
+++ lib/AppConfig/File.pm 2012-09-20 11:11:04.000000000 -0400
@@ -427,7 +427,7 @@
if ($expand & AppConfig::EXPAND_ENV) {
$$value =~ s{
- ( \$ \{ (\w+) \} )
+ ( \$ [{] (\w+) [}] )
} {
$var = $2;