# 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' => {
},
);
-###
-### 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);
my %version;
my $exit_value = 0;
+my @oneliners;
my $title = "MythTV status for $c->{'host'}";
my $output = "$title\n";
$output .= '=' x length($title) . "\n";
# Find the longest header
my $length = 0;
- for $line (@oneliners) {
+ for my $line (@oneliners) {
if (length($line->[0]) > $length) {
$length = length($line->[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 $line (@oneliners) {
+ for my $line (@oneliners) {
$oneliners .= ($c->{'oneliner_bullets'} ? '* ' : '' )
. "$line->[0]"
. ('.' x ($length - length($line->[0]))) . ": $line->[1]\n";
# Surpress warnings from DBI. I tried unsetting $^W but that is ignored.
local($SIG{__WARN__}) = sub { if ($verbose) { print shift } };
- eval { $myth = new MythTV() };
+ eval { $myth = MythTV->new() };
if ($@) {
if ($verbose) {
# MythTV::Program currently has a slightly broken line with a numeric
# comparision.
local($^W) = 0;
- $show = new MythTV::Program(@$row);
+ $show = MythTV::Program->new(@$row);
}
if ($show->{'recstatus'} == $recstatus_conflict) {
# MythTV::Program currently has a slightly broken line with a numeric
# comparision.
local($^W) = 0;
- $show = new MythTV::Program(@$row);
+ $show = MythTV::Program->new(@$row);
}
# Who cares about LiveTV recordings?
$options->{'time'} //= 1;
# 2012-10-17T23:50:08Z
- my $d = new Date::Manip::Date;
+ my $d = Date::Manip::Date->new();
$d->parse($date);
# Work out our local timezone. The Date::Manip::Date
my ($url) = @_;
$| = 1;
- my $pid = pipe_from_fork('CHILD');
+ my $pid = pipe_from_fork(*CHILD);
if ($pid) {
# parent
my $content_type;
}
# simulate open(FOO, "-|")
-sub pipe_from_fork ($) {
+sub pipe_from_fork {
my $parent = shift;
$SIG{CHLD} = 'IGNORE';