™.. General::Interpolated - Online Linux Manual PageSection : 3
Updated : 2013-07-03
Source : perl v5.10.1
Note : User Contributed Perl Documentation
NAMEConfig::General::Interpolated − Parse variables within Config files
SYNOPSIS use Config::General;
$conf = Config::General−>new(
−ConfigFile => 'configfile',
−InterPolateVars => 1
);
DESCRIPTIONThis is an internal module which makes it possible to interpolate Perl style variables in your config file (i.e. $variable or \*(C`${variable}\*(C'\fR). Normally you don't call it directly.
VARIABLESVariables can be defined everywhere in the config and can be used afterwards as the value of an option. Variables cannot be used as keys or as part of keys. If you define a variable inside a block or a named block then it is only visible within this block or within blocks which are defined inside this block. Well − let's take a look to an example: # sample config which uses variables
basedir = /opt/ora
user = t_space
sys = unix
<table intern>
instance = INTERN
owner = $user # "t_space"
logdir = $basedir/log # "/opt/ora/log"
sys = macos
<procs>
misc1 = ${sys}_${instance} # macos_INTERN
misc2 = $user # "t_space"
</procs>
</table>
This will result in the following structure: {
'basedir' => '/opt/ora',
'user' => 't_space'
'sys' => 'unix',
'table' => {
'intern' => {
'sys' => 'macos',
'logdir' => '/opt/ora/log',
'instance' => 'INTERN',
'owner' => 't_space',
'procs' => {
'misc1' => 'macos_INTERN',
'misc2' => 't_space'
}
}
}
As you can see, the variable sys has been defined twice. Inside the <procs> block a variable ${sys} has been used, which then were interpolated into the value of sys defined inside the <table> block, not the sys variable one level above. If sys were not defined inside the <table> block then the ‟global” variable sys would have been used instead with the value of ‟unix”. Variables inside double quotes will be interpolated, but variables inside single quotes will not interpolated. This is the same behavior as you know of Perl itself. In addition you can surround variable names with curly braces to avoid misinterpretation by the parser.
SEE ALSOConfig::General
AUTHORS Thomas Linden <tlinden |AT| cpan.org>
Autrijus Tang <autrijus@autrijus.org>
Wei−Hon Chen <plasmaball@pchome.com.tw>
COPYRIGHTCopyright 2001 by Wei-Hon Chen <plasmaball@pchome.com.tw>. Copyright 2002−2013 by Thomas Linden <tlinden |AT| cpan.org>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <http://www.perl.com/perl/misc/Artistic.html>
VERSION2.15 0
Johanes Gumabo
Data Size : 9,875 byte
man-Config::General::Interpolated.3pmBuild : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 2 / 189,628
Visitor ID : :
Visitor IP : 18.188.218.219 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (parse_manual_page_|249|Config::General::Interpolated.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\|
) (htmlprn|149|Config::General::Interpolated.3pm|36/37|.el══─{─══. ds -- — |.el══─{─══. ds -- \|\(em\|
) (parse_manual_page_|249|Config::General::Interpolated.3pm|41|br══─}─══|'br══─}─══
) (htmlprn|149|Config::General::Interpolated.3pm|41|'br══─}─══ |'br══─}─══
) (rof_nr_x|149|Config::General::Interpolated.3pm|51/52|\nF|.ie \nF ══─{─══. de IX
) (rof_unit_scale_px|41|Config::General::Interpolated.3pm|51/52|F|.ie \nF ══─{─══. de IX
) (rof_if|19|Config::General::Interpolated.3pm|51/52|\nF|.ie \nF ══─{─══. de IX
) (htmlprn|149|Config::General::Interpolated.3pm|51/52|.ie \nF ══─{─══. de IX|.ie \nF ══─{─══. de IX
) (rof_escape_sequence|91|Config::General::Interpolated.3pm|53|\$1\t\\n%\t"\\$2" |. tm Index:\\$1\t\\n%\t"\\$2"
) (parse_manual_page_|249|Config::General::Interpolated.3pm|57|══─}─══|.══─}─══
) (htmlprn|149|Config::General::Interpolated.3pm|57|.══─}─══ |.══─}─══
) (rof_escape_sequence|91|Config::General::Interpolated.3pm|147|\*(C`${variable}\*(C'\fR). |or \f(CW\*(C`${variable}\*(C'\fR).
)