摘要:
循环的默认控制变量为$_ 参数数组@_ sub max { $max = shift @_; foreach(@_) { if ($_ > $max) { $max = $_; } } $max; } $maxNum = &max (1, 5, 3, 2); //列表可能为空, 调用者得注意返回值可能为undef my($num) = @_; #list context, same with ($num) = @_; return the first one of parameters. my $num ...
阅读全文