I am using Module::Load to load a module dynamically.
But I am not able to invoke a method defined in the module. Here is what I am doing
my $module = load("Module");
$module->function();
I am getting the following error:
Can’t call method “function” without a package or object reference
What is wrong in the above code?
The
loadfunction doesn’t have a specified return value. I think you’re looking for this: