I think that's eminently reasonable, and do it all the time.
For another layer of flexibility, you may want to use some other identifying string and then provide a hash that maps those strings to package names; using Class::Factory as lachoy suggests is a sensible implementation choice.
In reply to Re: OO: Building an object of the right type based on a parameter
by simonm
in thread OO: Building an object of the right type based on a parameter
by rkg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |