dod38fr / config-model

Perl module to create configuration editor with semantic validation
58 stars 12 forks source link

Fix regexps for Perl 5.22+ #6

Closed mat813 closed 8 years ago

mat813 commented 8 years ago

Starting with 5.22, a { in a regexp has to be escaped.

--- lib/Config/Model.pm.orig    2016-06-29 17:34:35 UTC
+++ lib/Config/Model.pm
@@ -718,10 +718,10 @@ sub translate_compute_info {
         map { $replace_h = delete $var{$_} if ref( $var{$_} ) } keys %var;

         # cleanup user formula
-        $user_formula =~ s/\$(\w+){/\$replace{/g;
+        $user_formula =~ s/\$(\w+)\{/\$replace{/g;

         # cleanup variable
-        map { s/\$(\w+){/\$replace{/g } values %var;
+        map { s/\$(\w+)\{/\$replace{/g } values %var;

         # change the hash *in* the info structure
         $info->{$new_name} = {
dod38fr commented 8 years ago

I guess that you mean starting from 5.24.

No matter. I've applied your patch. This will be part of next release

Thanks for the heads-up.

All the best