用cpan安装的模块未显示 [英] Module installed with cpan isn't showing up

查看:85
本文介绍了用cpan安装的模块未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用cpan安装Array::IteratorText::ParseWords.我在OSX上使用cpan v1.61和perl v5.18.2.

I'm trying to install Array::Iterator and Text::ParseWords using cpan. I'm on OSX with cpan v1.61 and perl v5.18.2.

启动cpan时,在进行初始配置后,键入install "Array::Iterator",它似乎已正确安装.但是,当我尝试使用use Array::Iterator运行我的perl脚本时,我得到了:

When I start up cpan, after the initial configuration, I type install "Array::Iterator" and it seems to install correctly. But when I try to run my perl script with use Array::Iterator, I get:

Can't locate Array/Iterator.pm in @INC (you may need to install the Array::Iterator module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at ./parse.pl line 7.
 at ./parse.pl line 7.
    main::BEGIN() called at ./parse.pl line 7
    eval {...} called at ./parse.pl line 7
BEGIN failed--compilation aborted at ./parse.pl line 7.
 at ./parse.pl line 7.

第7行是:

use Array::Iterator;

推荐答案

添加Array :: Iterator pm文件所在的完整路径. 在shebang行之后,可能是未加载路径之后,在脚本的开头使用以下代码

Add the complete PATH where your Array::Iterator pm file is located Use the below code in start of the script after shebang line may be the path is not loaded

BEGIN {push(@INC,'PATH')}

BEGIN { push( @INC, 'PATH' ) }

这篇关于用cpan安装的模块未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆