sub sum{ my $test = shift;#根据上下文这里是去一个标量, ($a) = @_试图从数组里面取一个标量 my $total=0; foreach(@$test){ $total=$total+$_; } return $total;}