my $dxchan;
foreach $dxchan (@ch) {
- @val = sort {$a->call cmp $b->call} grep { $_->dxchan == $dxchan } @nodes;
+ @val = sort {$a->call cmp $b->call} grep { $_->dxchan && $_->dxchan == $dxchan } @nodes;
@l = ();
my $call = $dxchan->call;
$call ||= '???';
$call = "($call)" unless $dxchan->here;
push @l, $call;
- my $i = 0;
foreach my $ref (@val) {
- if ($i >= 5) {
+ if (@l >= 6) {
push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
@l = ();
push @l, "";
- $i = 0;
}
my $s = $ref->call;
$s ||= '???';
$s = sprintf "(%s)", $s unless $ref->here;
push @l, $s;
- $i++;
}
- push @l, "" while ($i++ < 5);
+ push @l, "" while @l < 6;
push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
}
} else {
push @l, $call;
@val = sort $node->users;
- my $i = 0;
if (@val == 0 && $node->usercount) {
push @l, sprintf "(%d users)", $node->usercount;
}
foreach $call (@val) {
- if ($i >= 5) {
+ if (@l >= 6) {
push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
@l = ();
push @l, "";
- $i = 0;
}
my $uref = Route::User::get($call);
my $s = $call;
$s = "$call?";
}
push @l, $s;
- $i++;
}
- push @l, "" while ($i++ < 5);
+ push @l, "" while @l < 6;
push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
}
}