From: Andrew Ruthven Date: Fri, 12 Oct 2007 01:40:26 +0000 (+1300) Subject: If there are no items for a block, skip everything about that block. X-Git-Tag: 0.1~12 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1273987641e98cc2ae82feb806a6d5bb0b8e7697;p=mythtv-status.git If there are no items for a block, skip everything about that block. --- diff --git a/bin/status.pl b/bin/status.pl index bfa1093..d7e7371 100755 --- a/bin/status.pl +++ b/bin/status.pl @@ -77,8 +77,11 @@ my @blocks = ( for my $block (@blocks) { my $items = $xml->documentElement->find($block->{'xpath'}); - print "$block->{'name'}:\n" - if (scalar(@$items) > 0); + # Don't do any work on this block if there is nothing for it. + next + if (scalar(@$items) == 0); + + print "$block->{'name'}:\n"; for my $item (@{ $items }) { my $template = $block->{'template'};