Spidy has asked for the wisdom of the Perl Monks concerning the following question:
I have a piece of code that I'm writing. In order to make things easier, I've decided to store all of the configurable arguments into a hash, which is then stored on the hard drive, and loaded into the script(s) at runtime. The code which I used to recall the has is:
With "martha.225" being the configuration file. The problem is though, I have to put those 2 lines at the top of every script involving these variables that I write. This isn't an issue just yet, but soon enough there will be 25+ scripts relying on this information. Does anyone know of a way that I could use my config file, and not have to edit 25 files every time that I change the config file's name, or something?my %config = do "martha.225" or die("can't recreate config file: $! $@");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Configuration, without a Module?
by ikegami (Patriarch) on Mar 20, 2006 at 23:17 UTC | |
by Spidy (Chaplain) on Mar 21, 2006 at 03:10 UTC | |
|
Re: Configuration, without a Module?
by diotalevi (Canon) on Mar 20, 2006 at 23:17 UTC |