in reply to Re^2: Export function from module
in thread Export function from module
use HELPER;: Perl looks for a file named HELPER.pm from among the paths listed in @INC, and it is found. But use HELPER; is the same as saying:
BEGIN{ require HELPER; HELPER->import(); }
The problem is that second part; you have inherited Exporter into a package named Helper. So when Perl goes looking for HELPER->import() it doesn't find anything. And what does exist, Helper->import() isn't being called, because you're using HELPER, not Helper.
You may as well be saying:
BEGIN { require HELPER; Goofy->import(); }
Additonally, the fully qualified name of foo() isn't HELPER::foo, it's Helper::foo.
Dave
|
|---|