- 论坛徽章:
- 0
|
在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. |
|