X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fprefix.pl;h=b416bf4b004e4ef9c2552b980af572ae368f37f0;hb=78f7e0cc760aee1a38c38c83187fc050576dfb14;hp=ed53d9277b302f072c9cb775f7c80f68024f927f;hpb=6b6eda0362049fd67809f2789e523708a1a8cb13;p=spider.git diff --git a/cmd/show/prefix.pl b/cmd/show/prefix.pl index ed53d927..b416bf4b 100644 --- a/cmd/show/prefix.pl +++ b/cmd/show/prefix.pl @@ -5,23 +5,24 @@ # my ($self, $line) = @_; -my @list = split /\s+/, $line; # generate a list of callsigns +my @list = split /\s+/, $line; # generate a list of callsigns my $l; my @out; #print "line: $line\n"; foreach $l (@list) { - my @ans = Prefix::extract($l); - my $dd = new Data::Dumper([ \@ans ]); - print "ans:", $dd->Dumpxs; - next if !@ans; - my $pre = shift @ans; - my $a; - foreach $a (@ans) { - push @out, sprintf "%s DXCC: %d ITU: %d CQ: %d LL: %s %s (%s, %s)", uc $l, $a->dxcc, $a->itu, $a->cq, slat($a->lat), slong($a->long), $pre, $a->name; - $l = " " x length $l; - } + my @ans = Prefix::extract($l); + next if !@ans; + my $pre = shift @ans; + my $a; + foreach $a (@ans) { + push @out, sprintf "%s DXCC: %d ITU: %d CQ: %d LL: %s %s (%s, %s)", uc $l, $a->dxcc, $a->itu, $a->cq, slat($a->lat), slong($a->long), $pre, $a->name; + $l = " " x length $l; + } + if ($USDB::present && $ans[0]->state) { + push @out, sprintf "%s City: %s State: %s", $l, join (' ', map {ucfirst} split(/\s+/, lc $ans[0]->city)), $ans[0]->state; + } } return (1, @out);