-print OUT "%prefix = (\n";
-foreach $k (sort keys %pre) {
- print OUT " '$k' => [";
- my @list = @{$pre{$k}};
- my $l;
- my $str;
- foreach $l (@list) {
- $str .= " $l,";
- }
- chop $str;
- print OUT "$str ],\n";
+print OUT "\n\%prefix_loc = (\n";
+foreach my $l (sort {$a <=> $b} keys %locn) {
+ print OUT " $l => bless( {";
+ my ($name, $dxcc, $itu, $cq, $utcoff, $latd, $latm, $lats, $latl, $longd, $longm, $longs, $longl) = split /\s+/, $locn{$l};
+
+ $longd += ($longm/60);
+ $longd = 0-$longd if (uc $longl) eq 'W';
+ $latd += ($latm/60);
+ $latd = 0-$latd if (uc $latl) eq 'S';
+ my $qra = DXBearing::lltoqra($latd, $longd);
+ print OUT " name => '$name',";
+ print OUT " dxcc => $dxcc,";
+ print OUT " itu => $itu,";
+ print OUT " cq => $cq,";
+ print OUT " utcoff => $utcoff,";
+ print OUT " lat => $latd,";
+ print OUT " long => $longd,";
+ print OUT " qra => '$qra'";
+ print OUT " }, 'Prefix'),\n";