There's more than one way to do things | |
PerlMonks |
Re: Most effective way to dynamically load a module?by tilly (Archbishop) |
on Aug 22, 2006 at 04:06 UTC ( [id://568754]=note: print w/replies, xml ) | Need Help?? |
Simpler answer. Change your eval to eval "use $class ()"; and drop the can. Check the documentation, use already checks whether a class is loaded and doesn't reload it the second time. That check is more efficient than calling can. However use will call import. Since you don't need the calls to import, the empty parens can be used to get rid of them.
In Section
Seekers of Perl Wisdom
|
|