Config::General::Interpolated man page on Scientific

Man page or keyword search:  
man Server   26626 pages
apropos Keyword Search (all sections)
Output format
Scientific logo
[printable version]

General::Interpolated(User Contributed Perl DocumentatGeneral::Interpolated(3)

       Config::General::Interpolated - Parse variables within Config files

	use Config::General;
	$conf = Config::General->new(
	   -ConfigFile	    => 'configfile',
	   -InterPolateVars => 1

       This is an internal module which makes it possible to interpolate Perl
       style variables in your config file (i.e. $variable or "${variable}").

       Normally you don't call it directly.

       Variables 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
		misc1	= ${sys}_${instance}  # macos_INTERN
		misc2	= $user		      # "t_space"

       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.


	Thomas Linden <tlinden |AT|>
	Autrijus Tang <>
	Wei-Hon Chen <>

       Copyright 2001 by Wei-Hon Chen <>.  Copyright
       2002-2013 by Thomas Linden <tlinden |AT|>.

       This program is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.

       See <>


perl v5.10.1			  2013-07-03	      General::Interpolated(3)

List of man pages available for Scientific

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net