in reply to Config files
note that I had to change your double quotes to single quotes in the code ini file entry.# cat test.ini [path] root = C:\test code = $root . '\code1' # cat test.pl use Config::IniFiles; $ini = Config::IniFiles->new(-file => 'test.ini'); $root = $ini->val('path', 'root'); print "root = $root\n"; $code = $ini->val('path', 'code'); print "code = $code\n"; $code = eval $code; print "code = $code\n"; # perl test.pl root = C:\test code = $root . '\code1' code = C:\test\code1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Config files
by Jenda (Abbot) on Dec 07, 2004 at 01:53 UTC | |
|
Re^2: Config files
by sparkel (Acolyte) on Dec 06, 2004 at 23:48 UTC |