http://qs1969.pair.com?node_id=50839

BoredByPolitics has asked for the wisdom of the Perl Monks concerning the following question:

I've spent the evening looking at the AppConfig module, trying to work out the best way to use it in my application.

The basic functionality I'm trying to create is fairly standard -

Now, because the methods that parse a configuration file, and the commandline, are one shot tasks, at first glance it would appear that I'm going to have to parse the commandline, save the parameters specified in a hash, read in the correct configuration file, then overlay the stored parameters with those just loaded.

This may be the right way to go about it, but something's nagging at me that I'm missing something. Which leads me onto the second half of my question...

I notice that I can find out the configuration values held in the AppConfig object with the following method (right terminology?) - $config_object->variable_name();

Should I therefore avoid storing the result of this method in another variable, calling this method each time I need the value, or is this the overhead equivalent of calling a function multiple times needlessly?

I've not yet sat down and investigated OO for myself yet, having merely picked up bits here and there (mostly from using other peoples perl modules), so be gentle if I'm way off track!

Pete