X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=perl%2FDXProtout.pm;h=1ebb29bc8ceb7d356c7ac2d7309c2d4ad16d6a7b;hb=41beb204d8c619d5929f9b1368972885e1f49965;hp=6ee4fbcc150272d2465a4d26f3e2e28ea2c68fdf;hpb=a711fc132a7e18e67def6abeba3f8d18bbaae72f;p=spider.git diff --git a/perl/DXProtout.pm b/perl/DXProtout.pm index 6ee4fbcc..1ebb29bc 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 ( ; @_ && length $str < 200; $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); } @@ -112,12 +112,12 @@ 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 (; @_ && length $str < 200; $i++) { my $ref = shift; my $here = $ref->{here} ? '1' : '0'; my $confmode = $ref->{confmode} ? '1' : '0'; @@ -125,6 +125,7 @@ sub pc19 } $str .= sprintf "^%s^", get_hops(19); push @out, $str; + $i = 0; } return @out; }