in reply to Repeats exclusion

my $coord = 'coordinate.txt'; my $dist = 'dist.txt'; open COORD, '<', $coord or die "Couldn't read file $coord: $!"; open DIST, '<', $dist or die "Couldn't read file $dist: $!"; my %data; @data{ <COORD> } = <DIST>; for my $key ( keys %data ) { print "$key $data{$key}\n"; }

Replies are listed 'Best First'.
Re^2: Repeats exclusion
by BrowserUk (Patriarch) on Sep 12, 2010 at 09:51 UTC

    If later distances are greater than earlier ones, they will persist, and so the OPs goal of finding the lowest distance associated with each coordinate will not be achieved.