2009年2月25日星期三

[PerlChina] 包(.pm)的问题

#tt.pl
use strict;
use warnings;
use PM::MK1;
my ($zhu,$mark)=(1333,122222);
my $max=MK1->max($zhu,$mark);
print "3:MAX:$max\n";

#我的包文件MK1.pm
package MK1;
sub max{
shift(@_);
my($temp1,$temp2)=@_;
print "2:$temp1 ***$temp2\n";
if($temp1 > $temp2){
return $temp1;
}else{
return $temp2;
}
}

return 1;

如果我没用"shift(@_); " ,$temp1=MK1;
我不知道为什么?
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

没有评论: