Vsftp:/root/perl/7# cat scan1.pm
package scan1;
require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(fun1 frobnicate); ###导出fun1函数
sub fun1() {
my $a=shift;
my $b=shift;
return 67 + $a + $b;
};
Vsftp:/root/perl/7# cat a7.pl
unshift(@INC,"/root/perl/7");
use scan1 qw(fun1);
my $var=&fun1(3,4);
print $var;
print "
";
Vsftp:/root/perl/7# perl a7.pl
74