in reply to Avoiding hard-coding

You could change the problem around so that the config file is really a script, and calls the script (with the path to the config file as a parameter). The script reads the config file, and all of your hard coding is in one place.

This also allows multiple config files to share a script, but behave differently.

-QM
--
Quantum Mechanics: The dreams stuff is made of