jds17 has asked for the wisdom of the Perl Monks concerning the following question:
Here, $package_name is the fully qualified name of the role consuming package determined at runtime and method1,... are methods exported by this package.my $package_name = get_package_name(); eval "require $package_name"; eval "$package_name->import( qw( method1 method2 method3 )";
where MyPackage is the name of the current package (i.e. the one the above code is in) and not the desired one, i.e. $package_name.Undefined subroutine &MyPackage::num_records called at ...
|
---|