sub func($\@\%){
$arg1 = shift ;
@arg2 = @{(shift)};
%arg3 = %{(shift)};
print "\$arg1:", $arg1,"\n";
print "\@arg2:@arg2\n";
print "\%arg3:",%arg3;
}
@arr = (1 .. 19);
%hash =(
k1 => "v1",
k2 => "v2",
);
func("Hello world.",@arr,%hash);
#輸出結果:
$arg1:Hello world.
@arg2:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
%arg3:k2v2k1v1
沒有留言:
張貼留言