http://qs321.pair.com?node_id=204194


in reply to Re: Re: Re: Re: Broken Date Handling
in thread Broken Date Handling

Meditation, sort of.
Thanks for sharing this Davorg.
So is there some general wisdom we can glean from this?
Davorg was being clever, (no harm in that, hubris is good, right?). He likely felt justified in being clever, 'cos an eval'd timelocal would do the error checking for him. (Most of us would feel nice and comfy about that).
But crikey, it's a very serious error if it were to make its way into production code, the sort that gives ammo to Perl naysayers, imho.
Would more extensive testing have caught this? Undoubtedly yes.
Should Davorg have used a CPAN module like Date::Calc, or is that overkill? Maybe only he can decide.
Would this have happened if Davorg was coding in Java? Probably not, (but he'd still be working on the app.)
Is there a general rule we can apply to prevent ourselves from getting burnt like this?
TIA,
Perlcgi
  • Comment on Re: Re: Re: Re: Re: Broken Date Handling