X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProtout.pm;h=6894ac7875b6c001a6ff9af56a9338a1a6851c15;hb=c2c7c24afb2bd2126da043c45bc35ddbf5c327ac;hp=86ab0e86562269b4dfe47b8317a7b646fb432a31;hpb=9630876e30f288575b5343ec2d0b5bb6d67f92cc;p=spider.git diff --git a/perl/DXProtout.pm b/perl/DXProtout.pm index 86ab0e86..6894ac78 100644 --- a/perl/DXProtout.pm +++ b/perl/DXProtout.pm @@ -76,17 +76,17 @@ sub pc16 { my $self = shift; my @out; + my $i; - foreach (@_) { + for ($i = 0; @_; ) { my $str = "PC16^$self->{call}"; - my $i; - - for ($i = 0; @_ > 0 && $i < $DXProt::pc16_max_users; $i++) { + for ( ; @_ && $i < $DXProt::pc16_max_users; $i++) { my $ref = shift; $str .= sprintf "^%s %s %d", $ref->call, $ref->confmode ? '*' : '-', $ref->here; } $str .= sprintf "^%s^", get_hops(16); push @out, $str; + $i = 0; } return (@out); } @@ -102,7 +102,7 @@ sub pc17 # Request init string sub pc18 { - return "PC18^DXSpider Version $main::version Build $main::build^$DXProt::myprot_version^"; + return "PC18^DXSpider Version: $main::version Build: $main::build^$DXProt::myprot_version^"; } # @@ -112,12 +112,14 @@ sub pc19 { my $self = shift; my @out; + my $i; + - while (@_) { + for ($i = 0; @_; ) { my $str = "PC19"; my $i; - for ($i = 0; @_ && $i < $DXProt::pc19_max_nodes; $i++) { + for (; @_ && $i < $DXProt::pc19_max_nodes; $i++) { my $ref = shift; my $here = $ref->{here} ? '1' : '0'; my $confmode = $ref->{confmode} ? '1' : '0'; @@ -125,6 +127,7 @@ sub pc19 } $str .= sprintf "^%s^", get_hops(19); push @out, $str; + $i = 0; } return @out; }