Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Variables in Config Files....

by hiseldl (Priest)
on May 15, 2003 at 14:33 UTC ( #258399=note: print w/ replies, xml ) Need Help??


in reply to Variables in Config Files....

You could also use Config::General with interpolation turned on (see Config::General::Interpolated for full documentation).

# configfile InstallDir = /usr/local/me cfgFile = $InstallDir/conf/me.cfg ################################################## #!perl use strict; use warnings; use Data::Dumper; use Config::General; my $conf = new Config::General( -ConfigFile => 'configfile', -InterPolateVars => 1 ); print Dumper($conf->{'DefaultConfig'}); __END__ # ouptut ($VAR1 is $conf->{'DefaultConfig'}) : $VAR1 = { 'cfgFile' => '/usr/local/me/conf/me.cfg', 'InstallDir' => '/usr/local/me' };

Cheers!

--
hiseldl
What time is it? It's Camel Time!


Comment on Re: Variables in Config Files....
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://258399]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2014-12-25 15:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls