Halbird has asked for the wisdom of the Perl Monks concerning the following question:
The formatting is terrible at the moment since I'm just playing with it. I havn't included the CalculateDistance subroutine as it is quite long, but I can if it will help. I tried$Mam = 'Mammal.txt'; open(FILE, $Mam) or die "Error. Could not open '$Mam'."; while(<FILE>) { chomp; @Loc = split(/\t/, $_); my $Dist; $Dist = CalculateDistance(54.988056, -1.619444, $Loc[1], $Loc[2]);
but just get the number 0 repeated. The code should be displaying one number which represents the total number of animals found within 10KM of the coordinates provided. I can't see where I'm going wrong.while($Dist < 10) { $counter++; print "$counter animals are found withing 10KM\n" }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (Beginner) Return number of variables within a set distance.
by toolic (Bishop) on Mar 26, 2015 at 01:38 UTC | |
by Halbird (Novice) on Mar 26, 2015 at 01:45 UTC | |
|
Re: (Beginner) Return number of variables within a set distance.
by davido (Cardinal) on Mar 26, 2015 at 04:24 UTC | |
|
Re: (Beginner) Return number of variables within a set distance.
by marinersk (Priest) on Mar 26, 2015 at 11:06 UTC |