Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Arbritrarily requireing classes.by Gilimanjaro (Hermit) |
on Aug 03, 2004 at 16:14 UTC ( [id://379729]=note: print w/replies, xml ) | Need Help?? |
The
method is the one I use often. I'd name the variable $package though, because you're not actually naming the file. I sometimes even eval a 'use', so the import get's run. Be sure to keep checking $@ afterwards though... Not doing so is asking for trouble. You may want to expand the die a bit, something like: This'll just make the error messages a bit clearer for ya...
In Section
Seekers of Perl Wisdom
|
|