perl -w errors with perl-5.8.8-42.el5
Issue
-
Perl scripts that use the
timelocal()andtimegm()functions working fine up throughperl-5.8.8-41.el5, but changed behavior with the update toperl-5.8.8-42.el5. The scripts also work fine with RHEL6. The problem is shown when using the "-w" option, but goes away if remove the "-w" option. In all cases the script produces the correct result, but when using the "-w" flag the script shows out a lot of errors.- Created a simple perl script to illustrate the problem:
#!/usr/bin/perl -w
use Time::Local;
select(STDERR); $| = 1;
select(STDOUT); $| = 1;
# timestamp 2014-09-10 21:05:34
my ($year,$mon,$mday,$hr,$min,$sec) = (2014-1900,9-1,10,21,5,34);
print("here 1, sec=$sec, min=$min, hr=$hr, mday=$mday, mon=$mon, year=$year\n");
my $time = timelocal($sec,$min,$hr,$mday,$mon,$year);
print("here 2, time=$time\n");
my $tstr = localtime($time);
print("here 3, tstr=$tstr\n");
exit(0);
- The output:
here 1, sec=34, min=5, hr=21, mday=10, mon=8, year=114
Use of uninitialized value in integer addition (+) at /usr/lib/perl5/5.8.8/Time/Local.pm line 81.
Use of uninitialized value in integer multiplication (*) at /usr/lib/perl5/5.8.8/Time/Local.pm line 81.
Use of uninitialized value in integer multiplication (*) at /usr/lib/perl5/5.8.8/Time/Local.pm line 81.
Use of uninitialized value in pack at /usr/lib/perl5/5.8.8/Time/Local.pm line 72.
Use of uninitialized value in pack at /usr/lib/perl5/5.8.8/Time/Local.pm line 72.
Use of uninitialized value in integer addition (+) at /usr/lib/perl5/5.8.8/Time/Local.pm line 73.
Use of uninitialized value in integer addition (+) at /usr/lib/perl5/5.8.8/Time/Local.pm line 74.
Use of uninitialized value in integer addition (+) at /usr/lib/perl5/5.8.8/Time/Local.pm line 72.
Use of uninitialized value in integer addition (+) at /usr/lib/perl5/5.8.8/Time/Local.pm line 81.
Use of uninitialized value in integer multiplication (*) at /usr/lib/perl5/5.8.8/Time/Local.pm line 81.
Use of uninitialized value in integer multiplication (*) at /usr/lib/perl5/5.8.8/Time/Local.pm line 81.
Use of uninitialized value in pack at /usr/lib/perl5/5.8.8/Time/Local.pm line 72.
Use of uninitialized value in pack at /usr/lib/perl5/5.8.8/Time/Local.pm line 72.
Use of uninitialized value in integer addition (+) at /usr/lib/perl5/5.8.8/Time/Local.pm line 72.
here 2, time=1410397534
here 3, tstr=Wed Sep 10 21:05:34 2014
Environment
- Red Hat Enterprise Linux 5
- perl-5.8.8-42.el5
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.