in reply to How to import names from a dynamically required module
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to import names from a dynamically required module
by jds17 (Pilgrim) on Oct 02, 2012 at 22:20 UTC | |
by tobyink (Canon) on Oct 03, 2012 at 06:35 UTC | |
by choroba (Cardinal) on Oct 03, 2012 at 08:05 UTC | |
by tobyink (Canon) on Oct 03, 2012 at 08:59 UTC | |
by Anonymous Monk on Oct 03, 2012 at 08:55 UTC | |
by tobyink (Canon) on Oct 03, 2012 at 09:11 UTC |