diff options
| author | fukachan <fukachan> | 2003-01-28 05:33:33 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-01-28 05:33:33 +0000 |
| commit | d747e19e2d08371a59163508dbe50e28e9441322 (patch) | |
| tree | 74c34870edb8bd6e5369cbeb63b80c503995a16b /fml/lib/FML/Config.pm | |
| parent | 46a73d0c93feaa37a0161cc9879657400a64bcb2 (diff) | |
| download | fml8-d747e19e2d08371a59163508dbe50e28e9441322.tar.gz fml8-d747e19e2d08371a59163508dbe50e28e9441322.tar.bz2 fml8-d747e19e2d08371a59163508dbe50e28e9441322.zip | |
expand ${variable}
Diffstat (limited to 'fml/lib/FML/Config.pm')
| -rw-r--r-- | fml/lib/FML/Config.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fml/lib/FML/Config.pm b/fml/lib/FML/Config.pm index defdeba8..054f2893 100644 --- a/fml/lib/FML/Config.pm +++ b/fml/lib/FML/Config.pm @@ -3,7 +3,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Config.pm,v 1.76 2002/12/24 10:19:41 fukachan Exp $ +# $FML: Config.pm,v 1.77 2003/01/11 06:58:44 fukachan Exp $ # package FML::Config; @@ -712,6 +712,7 @@ sub _expand_variables while ($max++ < 16) { $org = $config->{ $x }; + # expand $prefix -> something $config->{$x} =~ s/\$([a-z_]+[a-z0-9])/(defined $config->{$1} ? $config->{$1} : @@ -720,6 +721,15 @@ sub _expand_variables '' ))/ge; + # expand ${prefix} -> something + $config->{$x} =~ + s/\$\{([a-z_]+[a-z0-9])\}/(defined $config->{$1} ? + $config->{$1} : + (defined $hints->{$1} ? + $hints->{$1} : + '' + ))/ge; + __expand_special_macros( $config, $x ); last EXPANSION_LOOP if $config->{ $x } !~ /\$/o; |
