On Sat, Jan 12, 2013 at 8:21 PM, Ronald J Kimball <[email protected]> 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) http://www.perlmonks.org/?node_id=936850. -- Charles DeRykus _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: [email protected] > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: [email protected] SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays WEB PAGE: http://seattleperl.org/
