ActivePerlに激しくはめられた件
test.pl
#!/usr/bin/perl -w
use Time::Local;
$epoc = timelocal(0,0,0,22,11,2005);
print $epoc;exit;
結果。
色々手を尽くしても結局エラーだが出るの。
Use of uninitialized value in integer addition (+) at C:/Perl/lib/Time/Local.pm line 76.
Use of uninitialized value in integer multiplication (*) at C:/Perl/lib/Time/Local.pm line 76.
Use of uninitialized value in integer multiplication (*) at C:/Perl/lib/Time/Local.pm line 76.
Use of uninitialized value in pack at C:/Perl/lib/Time/Local.pm line 67.
Use of uninitialized value in pack at C:/Perl/lib/Time/Local.pm line 67.
Use of uninitialized value in integer addition (+) at C:/Perl/lib/Time/Local.pm line 68.
Use of uninitialized value in integer addition (+) at C:/Perl/lib/Time/Local.pm line 69.
Use of uninitialized value in integer addition (+) at C:/Perl/lib/Time/Local.pm line 67.
最後の頼みの綱、、、バージョンか???
C:\> perl -v
C:\>perl -v
This is perl, v5.8.6 built for MSWin32-x86-multi-thread
(with 3 registered patches, see perl -V for more detail)Copyright 1987-2004, Larry Wall
Binary build 811 provided by ActiveState Corp. http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Dec 13 2004 09:52:01
ひとつ前のバージョンを入れてみる。
C:\>perl -v
This is perl, v5.6.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)Copyright 1987-2001, Larry Wall
Binary build 638 provided by ActiveState Corp. http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Apr 13 2004 19:24:21Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
test.pl実行!
C:\>perl.pl
1135177200
('A`)
ヌッコロス。
(追記)
でも冷静に考えると最新版でこんなエラーが出るなんて絶対おかしいよな。
家に帰ってから追試してみよう。ああ、めんどいな。
(追記その2)
結論:バグ。Bugzillaでトラックされていました。See -> https://bugzilla.mozilla.org/show_bug.cgi?id=281920
Comment #8にマニュアル修正の方法が出ています。以下抜粋
Time::Local 1.11 fixes this and the fix is simple.
edit lib/Time/Local.pm, look for the following line (should be at line 35):
$MinInt = -$MaxInt - 1;
change it to:
$MinInt = 0;
まさかここまで見ることになろうとはね(苦笑