in reply to Re: Re: Nearest Neighbour Analysis subroutine
in thread Nearest Neighbour Analysis subroutine
Elias if you pass a reference to an array then @_ receives that reference -- that is, one element (no matter how big the array is). In testthearray1(\@test) you are only passing in one element. In testthearray2() you aren't passing in anything at all.
The routine I showed should just be called as:
my @array = (1,2,3,4,5,6); my $ndist_sum = nneighbours(@array);
|
|---|