我编写了这段代码,当系统中安装了 POE 模块时它可以工作。
#!/usr/bin/perl
use strict;
use warnings;
use POE;
...
但我想确定这个模块是否存在:
#!/usr/bin/perl
use strict;
use warnings;
eval("use POE; 1") or die ('Please, install POE module. \n');
...
它返回:
Bareword "KERNEL" not allowed while "strict subs" in use at ./terminalhero.perl line 58.
Bareword "HEAP" not allowed while "strict subs" in use at ./terminalhero.perl line 60.
Execution of ./terminalhero.perl aborted due to compilation errors.
我尝试了其他模块,也有错误。如何使用严格模式做我想做的事?