tidy up prefix handling
[spider.git] / perl / Route.pm
index a9f80fea4e3afe8b1e546c88444fd202467141f8..0f52e39b4023285ad994ad533feb18d66ad11f19 100644 (file)
@@ -68,14 +68,9 @@ sub new
        dbg("create $pkg with $call") if isdbg('routelow');
 
        # add in all the dxcc, itu, zone info
-       my @dxcc = Prefix::extract($call);
-       if (@dxcc > 0) {
-               $self->{dxcc} = $dxcc[1]->dxcc;
-               $self->{itu} = $dxcc[1]->itu;
-               $self->{cq} = $dxcc[1]->cq;
-               $self->{state} = $dxcc[1]->state;
-               $self->{city} = $dxcc[1]->city;
-       }
+       ($self->{dxcc}, $self->{itu}, $self->{cq}, $self->{state}, $self->{city}) =
+               Prefix::cty_data($call);
+
        $self->{flags} = here(1);
        
        return $self;