barbie has asked for the wisdom of the Perl Monks concerning the following question:
So I decided to have a look at what is going on inside timelocal(). Unfortunately the culprit seems to be localtime(). With negative values it prints nothing. Thankfully Time::Local can cope with this and still returns a valid negative number.
My problem now is how do I stop these warnings of "Use of uninitialized value in integer addition..." etc while running my tests? Bear in mind this a Perl function running from a Perl Core module.
Do I simply not allow tests of dates before the epoch if running on Windows (I'd rather not have to do that *), or is there some way I can tell localtime the world is not going to end or perhaps a switch for the test harness that can suppress them? Or is there another way?
* Though I note that Time::Local ignores dates before the epoch in tests ... hmmm, I wonder why.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Barbie
Birmingham Perl Mongers
Web Site: http://birmingham.pm.org/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Windows, Time::Local and dates before the epoch
by fglock (Vicar) on Jun 11, 2003 at 14:52 UTC | |
by barbie (Deacon) on Jun 11, 2003 at 15:10 UTC | |
|
Re: Windows, Time::Local and dates before the epoch
by Skeeve (Parson) on Jun 12, 2003 at 05:24 UTC | |
by barbie (Deacon) on Jun 12, 2003 at 11:45 UTC | |
by Skeeve (Parson) on Jun 12, 2003 at 13:17 UTC |