if (eval "require $package_name; 1") { $package_name->import(qw/method1 method2 method3/); }
It's often a good idea to lift imports to compile-time using a BEGIN block.
In reply to Re: How to import names from a dynamically required module
by tobyink
in thread How to import names from a dynamically required module
by jds17
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |