http://www.perlmonks.org?node_id=109786


in reply to Best practice with polymorphic constructors

Please correct me if I am wrong or missing something. It seems to me that the module name in the config file is primarily a "key" to identify the particular user/password pair you are using. So why not structure the config file thus:
<mydb> <config user="fooser" pass="foo" /> <modify user="barser" pass="bar" /> </mydb>
(Or, you could specify a database or any other information in there.) Then you could retrieve the credentials based on the functionality, not the module name. Does that make sense?

HTH, --traveler