+ -
当前位置:首页 → 问答吧 → Can't locate package Export 问题在WIN7下

Can't locate package Export 问题在WIN7下

时间:2010-10-29

来源:互联网

在win7下,一个很简单的调用自己写的模块, 为什么不能工作, unix 可以的。
1.  操作系统
Perl 版本:
Summary of my perl5 (revision 5 version 12 subversion 2) configuration:
  Platform:
    osname=MSWin32, osvers=5.2, archname=MSWin32-x64-multi-thread
    uname=''
WIN7:  WIN 7 ENT Image v6.1.2010 (64bit)
   
2. ## mine.pm 模块
## 在目录  C:\winperl\modules
package mine;
use strict;
require Exporter;
our @ISA = qw(Export);
our @EXPORT_OK = qw(test_sub);

sub test_sub {
          print "Here we are, test_sub \n";
}

3. 主程序:(top.pl)

#! C:\Perl64\bin\perl -w

use strict;
use lib ("C:\\winperl\\modules");
print "@INC \n\n";

use mine qw(test_sub);
&test_sub;

4. 运行结果:
C:\winperl>C:\Perl64\bin\perl top.pl
Can't locate package Export for @mine::ISA at top.pl line 7.
C:\winperl\modules C:/Perl64/site/lib C:/Perl64/lib .
Undefined subroutine &main::test_sub called at top.pl line 8.

作者: phoeny_xu   发布时间: 2010-10-29

Exporter, @ISA = qw/Exporter/;

作者: zhlong8   发布时间: 2010-10-29

谢谢, 原来copy过来的时候不小心删掉了点东西。。

现在好了。。

作者: phoeny_xu   发布时间: 2010-10-29