in reply to Code versus Config

In your case, maybe putting the configuration data in the DATA section could help.

If you store your "sane" configuration data in the DATA section and initialize your stuff from there, you can after that go looking if the user specified another configuration file and read that in in the same manner you did read in your DATA section. Thus you have both, a single file that works and the option to have a configuration file.

For an example on how to use the DATA section, go here (the sourcecode version of the node)

Replies are listed 'Best First'.
RE: Simple config solution
by Odud (Pilgrim) on Jun 06, 2000 at 12:22 UTC
    People have recommended putting the config into __DATA__ and this combined with an optional config file seems to me to be the best solution. If someone removes the config file then at least the script will continue to work with a reasonable set of defaults. Thanks to everyone who replied to this question.