Perl 给了我这个:
Use of uninitialized value $k in addition (+) at ./one.pl line 98, <FILE2> line 2000.
截取的代码如下:
sub calcMu
{
my $sum = 0;
my $lengStrs = length($_[0]);
my $lengArray = @_;
my $k = 0;
my @result = makeDistMatMu(@_);
for $k (@result) {$sum += $k;}
$sum/($lengStrs * ($lengArray*($lengArray-1)/2));
}
在@result 我们有例如 (0.1, 0.2, 0.1, 0.4, 0.5, 0.1)