SPUG: Date::Manip infinite loop

Charles DeRykus derykus at gmail.com
Sun Jan 13 06:07:55 PST 2013

On Sat, Jan 12, 2013 at 8:21 PM, Ronald J Kimball <rjk-spug at tamias.net> wrote:
> On Sat, Jan 12, 2013 at 02:36:35PM -0800, Joel Grow wrote:
>> Hello SPUG gurus,
>> I'm stumped as to why the code below gets into an infinite loop on
>> November 4, 2012.  I tried starting $current_date at Jan 1, 2011, and it
>> gets into an infinite loop on November 6, 2011. This is on a linux box
>> running perl 5.10.1.  When I run it on another linux box running 5.8.8,
>> it works fine. Any idea what's going on? Thanks!
> Daylight Saving Time ended on November 4 in 2012, and on November 6 in
> 2011.  Somehow Date::Manip is not handling this correctly when adding a
> day.

s/ correctly /in a DWIM-ish way/.  I think the gist is that
Date::Manip's definition of 24 hrs="1 day" may produce a
daylight savings surprise as happens here. A similar thing
would happen if you just bump up the year to add "1 year"
if the current date happens  to be Feb 29. Both cases need
a bit of  DWIM magic.

Date::Manip's author discusses the issue in depth here
and mentions his intent to add some more DWIMery
(which may have already happened)


Charles DeRykus
> Seattle Perl Users Group Mailing List
>      POST TO: spug-list at pm.org
> SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list
>     MEETINGS: 3rd Tuesdays
>     WEB PAGE: http://seattleperl.org/

More information about the spug-list mailing list