Then, you would refer to %MyConfig::hashone, $MyConfig::scalarone and so forth. Which would keep the variables out of the global name space and give you a visual clue (the package name) that these variables are in the config file. But, again, Config::Simple is by far a better solution.package MyConfig; # Scalar Variables our $scalarone = "one"; our $scalartwo = "two"; our $scalarthree = "three"; our $scalarfour = "four"; our $scalarfive = "five"; # Array Variables our @arrayone = ('one', 'two', 'three', 'four', 'five'); our @arraytwo = ('six', 'seven', 'eight', 'nine', 'ten'); # Hash Variables our %hashone = ( ONE => 'one', TWO => 'two', THREE => 'three', FOUR => 'four', FIVE => 'five');
---
s;;:<).>|\;\;_>?\\^0<|=!]=,|{\$/.'>|<?.|/"&?=#!>%\$|#/\$%{};;y;,'} -/:-@[-`{-};,'}`-{/" -;;s;;$_;see;
Warning: Any code posted by tuxz0r is untested, unless otherwise stated, and is used at your own risk.
In reply to Re: Moving variables to config file
by tuxz0r
in thread Moving variables to config file
by monk2b
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |