Skip to content

Commit

Permalink
In Perl_Config.pm: Fixed the perl left/right brace matching problem. …
Browse files Browse the repository at this point in the history
…The right brace now needs to be escaped similar to the left brace.
  • Loading branch information
gmao-jstassi committed Feb 3, 2025
1 parent f529a55 commit 856c329
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions GMAO_etc/Perl_Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,14 @@ sub expand {
#------------------------------------------
foreach $var (@vars) {
($varname = $var) =~ s/[\$\{\}]//g;
($varname = $var) =~ s/\$//; # remove '$'
$varname =~ s/\{//; # remove '{'
$varname =~ s/}//; # remove '}'
$val_ENV = $ENV{$varname};
$val_eval = eval($var);
$var =~ s/([\$\{])/\\$1/; # change '$' => '\$' and '{' => '\{'
$var =~ s/(\$)/\\$1/; # change '$' => '\$'
$var =~ s/(\{)/\\$1/; # change '{' => '\{'
$strOUT =~ s/$var/$val_ENV/ if defined($val_ENV);
$strOUT =~ s/$var/$val_eval/ if defined($val_eval);
Expand Down

0 comments on commit 856c329

Please sign in to comment.