Subject: | Fix for "Use of uninitialized value in substitution (s///)", if "date" is not available |
Date: | Wed, 13 Jun 2007 21:44:44 +0200 |
To: | bug-DateManip [...] rt.cpan.org |
From: | dAniel hAhler <daniel [...] thequod.de> |
Hi,
if the "date" command is not available, e.g. in a chroot environment,
you'll get the following notices:
Use of uninitialized value in substitution (s///) at /usr/share/perl5/Date/Manip.pm line 3603.
Use of uninitialized value in substitution (s///) at /usr/share/perl5/Date/Manip.pm line 3605.
The following patch fixes this:
# diff -u /usr/share/perl5/Date/Manip.pm /var/www/usr/share/perl5/Date/Manip.pm
--- /usr/share/perl5/Date/Manip.pm 2007-06-13 20:28:05.000000000 +0200
+++ /var/www/usr/share/perl5/Date/Manip.pm 2007-06-13 21:31:42.000000000 +0200
@@ -3550,7 +3550,7 @@
$tz=(split(/\s+/,$tz))[4];
}
}
- push(@tz,$tz);
+ push(@tz,$tz) if defined $tz;
} else {
# We need to satisfy taint checking, but also look in all the
# directories in @DatePath.
@@ -3564,7 +3564,7 @@
chomp($tz);
$tz=(split(/\s+/,$tz))[4];
}
- push(@tz,$tz);
+ push(@tz,$tz) if defined $tz;
}
}
Additionally I've seen that e.g. "Europe/Berlin" cannot get parsed by
Date_TimeZone; it appears to be not in the list with e.g. "US/Pacific".
Now I've installed the "date" binary in the chroot and this works out.
I've come apart Date::Manip, because munin-cgi-graph (from the "munin"
package) uses it.
Thank you.
Message body not shown because it is not plain text.