免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3766 | 回复: 8
打印 上一主题 下一主题

Can't locate NetPacket/Ethernet.pm in @INC怎么办?? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-05-24 13:22 |只看该作者 |倒序浏览
先perl ****,没 问题,然后就 chmod a+x ****

[root@localhost bishe]# ./id.pl
Can't locate NetPacket/Ethernet.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl
/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at ./id.pl line 9.
BEGIN failed--compilation aborted at ./id.pl line 9.

这是怎么 回事呢?该怎么解决?

论坛徽章:
0
2 [报告]
发表于 2004-05-24 13:51 |只看该作者

Can't locate NetPacket/Ethernet.pm in @INC怎么办??

谁能帮我么 ?

论坛徽章:
0
3 [报告]
发表于 2004-05-24 14:02 |只看该作者

Can't locate NetPacket/Ethernet.pm in @INC怎么办??

require Net:capUtils;
require NetPacket::TCP;
require NetPacket::SMB;
require NetPacket::FTP;
use NetPacket::IP qw(:protos);
use NetPacket::Ethernet qw(:strip);

require 改为use的 话都出现上面的问题,最后两个模块改为require的话perl ***通不过,该怎么解决讷?

论坛徽章:
0
4 [报告]
发表于 2004-05-24 14:09 |只看该作者

Can't locate NetPacket/Ethernet.pm in @INC怎么办??

NetPacket::Ethernet模块未安装

论坛徽章:
0
5 [报告]
发表于 2004-05-24 14:23 |只看该作者

Can't locate NetPacket/Ethernet.pm in @INC怎么办??

安装 了的 啊,perl ****也能通过的和FTP模块在同一目录的

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
6 [报告]
发表于 2004-05-24 19:10 |只看该作者

Can't locate NetPacket/Ethernet.pm in @INC怎么办??

use lib '/path/to/Ftp modules';

as first line of your program.

论坛徽章:
0
7 [报告]
发表于 2004-05-24 23:11 |只看该作者

Can't locate NetPacket/Ethernet.pm in @INC怎么办??

apile: 这句什么意思?时不时让程序去ftp模块所在目录去找模块呢?但是还是不行,还有如果用use的话每一个模块都是这样的结果,但另一个程序:
use Net:capUtils;
sub gotapacket {
my ($userdata,$header,$packet);
print "got a packet of length ",
$header->;{caplen},"\n";
}
Net:capUtils::loop(\&gotapacket,
NUMPACKETS =>; 10,
FILTER =>;
"tcp[13] & 2 != 0 and src net not 192.168.0";

perl *.pl就直接运行了,很奇怪啊

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
8 [报告]
发表于 2004-05-25 08:25 |只看该作者

Can't locate NetPacket/Ethernet.pm in @INC怎么办??

does the first line of your program is
#!/usr/bin/perl

I guess you don't put the line above as your first line...
#!/usr/bin/perl
use Net:capUtils;
sub gotapacket {
my ($userdata,$header,$packet);
print "got a packet of length ",
$header->;{caplen},"\n";
}
Net:capUtils::loop(\&gotapacket,
NUMPACKETS =>; 10,
FILTER =>;
"tcp[13] & 2 != 0 and src net not 192.168.0";

like above ....try again..

论坛徽章:
0
9 [报告]
发表于 2004-05-30 00:21 |只看该作者

Can't locate NetPacket/Ethernet.pm in @INC怎么办??

yes and if i perl *.pl
[root@localhost bishe]# perl cap
got a packet of length
got a packet of length
got a packet of length
got a packet of length
got a packet of length
got a packet of length
got a packet of length
got a packet of length
got a packet of length
got a packet of length


then i chmod a+x *.pl

[root@localhost bishe]# ./cap
./cap: line 3: use: command not found
./cap: line 4: sub: command not found
./cap: line 5: syntax error near unexpected token `$userdata,$header,$packet'
./cap: line 5: `my ($userdata,$header,$packet);'

what's the matter?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP