|
Hi,
I'd like to include a Perl package in my Perl script using the 'use' stmt. However, the name of the package to be included is in a Perl variable. Is there a way to do this:
use $myPkgName;
thanks
|
|
|
Change the name of the perl variable.
|
|
|
or this..
eval "use $module_name";
|
|
|
#here you can fill @modules with a bunch of module names and they will all be loaded in code.
@modules = ("Arrays");
foreach(@modules) {eval "use $_";}
|
|
|