You're looking for a factory. There are a number of solutions out there - Module::Plugin is a good one. Catalyst does something similar. Alternately, you can do what Excel::Template::Factory does.
My criteria for good software:
Does it work?
Can someone else come in, make a change, and be reasonably certain no bugs were introduced?