Help for this page
@indices = sort {$dist[$a]<=>$dist[$b]} 0..$#dist; @dist = @dist[@indices]; @x = @x[@indices]; @y = @y[@indices]; @z = @z[@indices]; @name = @name[@incides];
for my $one (0..$#@dist-1) { my $two = $one; while (++$two < @dist && $dist[$two]-$dist[$one] <= $cutoff) { ... if sqrt(($x[$one]-$x[$two])**2+($y[$one]-$y[$two])**2+($z[ +$one]-$z[$two])**2) <= $cutoff; } }