if (length $link->{LatitudLongitud} > 5) { if (!$seen->{$link->{LatitudLongitud}}) { push @{$records->{$link->{LatitudLongitud}}}, $link->{ID}; $seen->{$link->{LatitudLongitud}} = 1; # make sure we set this, so we know its been seen already! } else { push @{$records->{$link->{LatitudLongitud}}}, $link->{ID}; } } if (length $link->{LatitudLongitud02} > 5 && $link->{LatitudLongitud} ne $link->{LatitudLongitud02}) { if (!$seen->{$link->{LatitudLongitud02}}) { push @{$records->{$link->{LatitudLongitud02}}}, $link->{ID}; $seen->{$link->{LatitudLongitud02}} = 1; # make sure we set this, so we know its been seen already! } else { push @{$records->{$link->{LatitudLongitud02}}}, $link->{ID}; } } $links->{$link->{ID}} = $link; #### map { my ($lat,$long) = split ",", $_; my @links = @{$records->{$_}}; my $box_contents; my @html_contents; my $num_links = $#links+1; foreach (@links) { my $link = $links->{$_}; # do stuff here } } keys %$seen;