############不引用子函数################
@a=("A","b","c");
@b=("D","E","F");
sub pritncontent{
my(@letter1,@letter2)=@_;
print "@letter1\n";
print "@letter2\n";
}
&pritncontent(@a,@b);
###############引用子函数#####################
@a=("A","b","c");
@b=("D","E","F");
sub pritncontent{
my($letter1,$letter2)=@_; #引用后这里必须是$作为引用
print "@$letter1\n";
print "@$letter2\n";
}
&pritncontent(\@a,\@b);
网友评论