【发布时间】:2016-10-25 09:06:50
【问题描述】:
有3个模块,所以它们按模式相互使用 a -> b -> c -> a。我无法编译这种情况。
例如,
我得到一个编译错误
"Throw" is not exported by the LIB::Common::Utils module
Can't continue after import errors at /root/bin/ppm/LIB/Common/EnvConfigMgr.pm line 13
BEGIN failed--compilation aborted at /root/bin/ppm/LIB/Common/EnvConfigMgr.pm line 13.
Utils.pm
use Exporter qw(import);
our @EXPORT_OK = qw(
GetDirCheckSum
AreDirsEqual
onError
Throw);
use LIB::Common::Logger::Log;
日志.pm
use Log::Log4perl;
use LIB::Common::EnvConfigMgr qw/Expand/;
EnvConfigMgr.pm
use Exporter qw(import);
our @EXPORT = qw(TransformShellVars ExpandString InitSearchLocations);
our @EXPORT_OK = qw(Expand);
use LIB::Common::Utils qw/Throw/;
为什么不编译以及如何使其工作?
【问题讨论】:
-
您还应该为您要导出的函数包含存根,以便我们可以复制/粘贴并尝试。
-
正如 simbabque 所说,我们需要看到的远不止这些。请显示使用这些模块并显示相同问题的
main.pl