mirror of
git://scm.dxcluster.org/scm/spider
synced 2024-09-21 15:57:12 +00:00
30 lines
583 B
Perl
30 lines
583 B
Perl
|
#
|
||
|
# show the usdb info for each callsign or prefix entered
|
||
|
#
|
||
|
# $Id$
|
||
|
#
|
||
|
# Copyright (c) 2002 Dirk Koopman G1TLH
|
||
|
#
|
||
|
|
||
|
my ($self, $line) = @_;
|
||
|
my @list = split /\s+/, $line; # generate a list of callsigns
|
||
|
|
||
|
my $l;
|
||
|
my @out;
|
||
|
|
||
|
return (1, $self->msg('db3', 'FCC USDB')) unless $USDB::present;
|
||
|
|
||
|
#print "line: $line\n";
|
||
|
foreach $l (@list) {
|
||
|
$l = uc $l;
|
||
|
my ($city, $state) = USDB::get($l);
|
||
|
if ($state) {
|
||
|
push @out, sprintf "%-7s -> %s, %s", $l,
|
||
|
join (' ', map {ucfirst} split(/\s+/, lc $city)), $state;
|
||
|
} else {
|
||
|
push @out, sprintf "%-7s -> Not Found", $l;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return (1, @out);
|