【发布时间】:2012-06-16 18:24:14
【问题描述】:
我想检测用户何时缺少所需的模块并打印友好的错误消息,说明他们需要安装什么。
到目前为止,我尝试将其放在脚本的开头:
eval {
use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ;
};
if ($@) {
die "Error: IO::Uncompress::Gunzip not installed: $@";
}
但 Perl 似乎死在“使用”行而不是“死”行,并且从不打印我的错误消息。
【问题讨论】:
标签: perl