X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FRoute.pm;h=6d5a3b0182ae978ecbcba7c631ee3645fdffa3a6;hb=cf0e4eb14cf2d18ce8012e20288f20abcbae665f;hp=387407669583ff325644bbc51d9517d1fc215de6;hpb=8178d787d7cc8040fa8958197582bba5c80e6f59;p=spider.git diff --git a/perl/Route.pm b/perl/Route.pm index 38740766..6d5a3b01 100644 --- a/perl/Route.pm +++ b/perl/Route.pm @@ -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; @@ -204,11 +199,13 @@ sub config } if ($printit) { - $line = ' ' x ($level*2) . "$call"; - $call = ' ' x length $call; + my $pcall = "$call:" . $self->obscount; + + $line = ' ' x ($level*2) . "$pcall"; + $call = ' ' x length $pcall; # recursion detector - if ((DXChannel->get($self->{call}) && $level > 1) || grep $self->{call} eq $_, @$seen) { + if ((DXChannel::get($self->{call}) && $level > 1) || grep $self->{call} eq $_, @$seen) { $line .= ' ...'; push @out, $line; return @out; @@ -286,7 +283,7 @@ sub alldxchan my @dxchan; # dbg("Trying node $self->{call}") if isdbg('routech'); - my $dxchan = DXChannel->get($self->{call}); + my $dxchan = DXChannel::get($self->{call}); push @dxchan, $dxchan if $dxchan; # it isn't, build up a list of dxchannels and possible ping times @@ -295,7 +292,7 @@ sub alldxchan foreach my $p (@{$self->{parent}}) { # dbg("Trying parent $p") if isdbg('routech'); next if $p eq $main::mycall; # the root - my $dxchan = DXChannel->get($p); + my $dxchan = DXChannel::get($p); if ($dxchan) { push @dxchan, $dxchan unless grep $dxchan == $_, @dxchan; } else { @@ -315,7 +312,7 @@ sub dxchan my $self = shift; # ALWAYS return the locally connected channel if present; - my $dxchan = DXChannel->get($self->call); + my $dxchan = DXChannel::get($self->call); return $dxchan if $dxchan; my @dxchan = $self->alldxchan; @@ -380,7 +377,6 @@ sub field_prompt # sub AUTOLOAD { - my $self = shift; no strict; my $name = $AUTOLOAD; return if $name =~ /::DESTROY$/; @@ -390,10 +386,9 @@ sub AUTOLOAD # this clever line of code creates a subroutine which takes over from autoload # from OO Perl - Conway - *$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}}; - &$AUTOLOAD($self, @_); + *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}}; + goto &$AUTOLOAD; -# @_ ? $self->{$name} = shift : $self->{$name} ; } 1;