From: Andrew Ruthven Date: Sat, 13 Feb 2021 21:42:18 +0000 (+1300) Subject: Revert "Minor updates to allow running with the proposed settings for Perl 7." X-Git-Tag: 1.0.2~8 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=768e38c716383449f5081728930ca30dccefd179;p=mythtv-status.git Revert "Minor updates to allow running with the proposed settings for Perl 7." This reverts commit 9a8e46303b776d15331ddfac99b9cbd0b319808c. --- diff --git a/ChangeLog b/ChangeLog index 0ca9c32..79c3d79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,3 @@ -2020-12-26 Andrew Ruthven - Minor updates to allow running with the proposed settings for Perl 7. - 2020-12-06 Andrew Ruthven Minor update to systemd service file. diff --git a/bin/mythtv-status b/bin/mythtv-status index ec27b2d..63f9685 100755 --- a/bin/mythtv-status +++ b/bin/mythtv-status @@ -199,11 +199,6 @@ if ($c->{'highlight'} > 0) { # Is a warning present? my $warn_present = 0; -# Work out today/tomorrow. -our $today = substr(ParseDate('today'), 0, 8); -our $tomorrow = substr(ParseDate('tomorrow'), 0, 8); - - # Allow setting some defaults for the output blocks. my %defaults = ( 'schedule' => { @@ -718,6 +713,12 @@ my @blocks = ( }, ); +### +### Set some useful variables +### +our $today = substr(ParseDate('today'), 0, 8); +our $tomorrow = substr(ParseDate('tomorrow'), 0, 8); + if ($c->{'date'}) { $today = substr(ParseDate($c->{'date'}), 0, 8); $tomorrow = substr(DateCalc($c->{'date'}, ParseDateDelta('1 day')), 0, 8); @@ -746,7 +747,6 @@ my ($xml, $charset, $myth); my %version; my $exit_value = 0; -my @oneliners; my $title = "MythTV status for $c->{'host'}"; my $output = "$title\n"; $output .= '=' x length($title) . "\n"; @@ -809,7 +809,7 @@ if (scalar(@oneliners) > 0) { # Find the longest header my $length = 0; - for my $line (@oneliners) { + for $line (@oneliners) { if (length($line->[0]) > $length) { $length = length($line->[0]); } @@ -820,7 +820,7 @@ if (scalar(@oneliners) > 0) { # oneliners block as a paragrap and wraps it. If it sees "bullets" # it believes it is a bulleted list and leaves it alone. my $oneliners = ""; - for my $line (@oneliners) { + for $line (@oneliners) { $oneliners .= ($c->{'oneliner_bullets'} ? '* ' : '' ) . "$line->[0]" . ('.' x ($length - length($line->[0]))) . ": $line->[1]\n"; @@ -945,7 +945,7 @@ sub load_perl_api { # Surpress warnings from DBI. I tried unsetting $^W but that is ignored. local($SIG{__WARN__}) = sub { if ($verbose) { print shift } }; - eval { $myth = MythTV->new() }; + eval { $myth = new MythTV() }; if ($@) { if ($verbose) { @@ -1048,7 +1048,7 @@ sub process_conflicts { # MythTV::Program currently has a slightly broken line with a numeric # comparision. local($^W) = 0; - $show = MythTV::Program->new(@$row); + $show = new MythTV::Program(@$row); } if ($show->{'recstatus'} == $recstatus_conflict) { @@ -1097,7 +1097,7 @@ sub process_auto_expire { # MythTV::Program currently has a slightly broken line with a numeric # comparision. local($^W) = 0; - $show = MythTV::Program->new(@$row); + $show = new MythTV::Program(@$row); } # Who cares about LiveTV recordings? @@ -1135,7 +1135,7 @@ sub process_iso_date { $options->{'time'} //= 1; # 2012-10-17T23:50:08Z - my $d = Date::Manip::Date->new(); + my $d = new Date::Manip::Date; $d->parse($date); # Work out our local timezone. The Date::Manip::Date @@ -1306,7 +1306,7 @@ sub xml_fetch { my ($url) = @_; $| = 1; - my $pid = pipe_from_fork(*CHILD); + my $pid = pipe_from_fork('CHILD'); if ($pid) { # parent my $content_type; @@ -1373,7 +1373,7 @@ sub xml_fetch { } # simulate open(FOO, "-|") -sub pipe_from_fork { +sub pipe_from_fork ($) { my $parent = shift; $SIG{CHLD} = 'IGNORE';