pileofrogs has asked for the wisdom of the Perl Monks concerning the following question:
I've just started playing around with AppConfig, and I love it!
As I'm working though, I realize there's a bit of a chicken-and-egg problem, and this isn't specific to AppConfig.
Say I want to use hard-coded default values, config file values and command line arg values. I want config file values to override default values and I want command line args to override both defaults and config file values.
The trick is, I want to specify the config file on the command line. That means I need to get the command line first even though it should be last. The obvious solution is to save the command line values somewhere and re-add them after adding the defaults and config file values.
Is there a better way to handle this?
-Thanks
Pileofrogs
Update:
Here's what I've come up with, and yes there is a default config file.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: command line args - a chicken and egg problem
by GrandFather (Saint) on Apr 12, 2006 at 01:24 UTC | |
|
Re: command line args - a chicken and egg problem
by Zaxo (Archbishop) on Apr 12, 2006 at 05:13 UTC | |
by sfink (Deacon) on Apr 12, 2006 at 06:00 UTC | |
|
Re: command line args - a chicken and egg problem
by jkeenan1 (Deacon) on Apr 12, 2006 at 01:40 UTC | |
|
Re: command line args - a chicken and egg problem
by Helter (Chaplain) on Apr 13, 2006 at 15:12 UTC |