in reply to calling a module in a folder within current directory
SomeModule.pm located in folder myModules
...will be loaded via
use myModules::SomeModule;
The module itself needs to state this namespace:
package myModules::SomeModule;
Alternatively, you have to extend perl's search path (in callModule.pl):
use lib "rose/myModules";
That way perl will search the folder "rose/myModules" for "SomeModule.pm" .
The statement use $file; is illegal. The documentation for use states: "(...) Module must be a bareword."
|
|---|