PDF ::使用cpan linux命令创建模块安装失败?

时间:2015-09-22 06:29:30

标签: linux perl module cpan

当我尝试安装cpan模块时,我收到以下错误,我通过谷歌搜索尝试,无法找到解决方案。

Catching error: "Can't locate object method \"Create\" via package   \"install PDF\" (perhaps you forgot to load \"install PDF\"?) at /usr/share /perl5/CPAN.pm line 376, <STDIN> line 1.\cJ" at /usr/share/perl5/CPAN.pm line 392, <STDIN> line 1.
CPAN::shell() called at /usr/share/perl5/App/Cpan.pm line 295
App::Cpan::_process_options('App::Cpan') called at /usr/share/perl5/App/Cpan.pm line 364
App::Cpan::run('App::Cpan') called at /usr/bin/cpan line 11

1 个答案:

答案 0 :(得分:3)

通过执行以下操作可以重现您的错误:

$ cpan
...
cpan shell -- CPAN exploration and modules installation (v2.10)
Enter 'h' for help.

cpan[1]> "install PDF::Create"
Catching error: "Can't locate object method \"Create\" via package   \"install PDF\" (perhaps you forgot to load \"install PDF\"?) ...

问题是你明显地在整个命令周围加上引号。

解决方案:删除引号:

cpan[2]> install PDF::Create

......在这里工作正常。

此外,您可以在不输入cpan shell的情况下执行cpan PDF::Create