At 07:30 AM 3/21/02 -0800, Randal L. Schwartz wrote: > >>>>> "Matt" == Matt C <[EMAIL PROTECTED]> writes: > >Matt> The Date::Manip module can do almost anything you can think of with >dates: >Matt> http://search.cpan.org/doc/SBECK/DateManip-5.40/Manip.pod > >Just beware of what I said last year in comp.lang.perl.modules: > > >>>>> "Ilya" == Ilya Martynov <[EMAIL PROTECTED]> writes: > > Ilya> Try Date::Manip. It handles many date formats. Really *many*. > > *really* *really* many. > > Every time I use Date::Manip in a program, the lights all dim in my > house. > > :-)
Now I enjoy the jokes as well, but this is somewhat FUD for a beginners' list. The real cost: [peter@tweety ~]$ perl -MDate::Manip -MTime::HiRes=time -le 'print time-$^T; print UnixDate("last Sunday","%Y-%m-%d"); print time-$^T; <STDIN>' 1.1953010559082 2002-03-17 1.29765999317169 Meanwhile, at another window: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND peter 2563 2.8 4.8 5612 4656 pts/3 S 16:45 0:01 perl ... By comparison: [peter@tweety ~]$ perl -MTime::HiRes=time -le 'print time-$^T; <STDIN>' 0.64349901676178 peter 2571 4.2 1.9 2856 1820 pts/3 S 16:47 0:00 perl ... Okay, so it adds .5 seconds of startup time and 3M of memory. And it takes a whopping .1 seconds to figure out when last Sunday was. Yeah, that's huge compared to most modules. But unless you're going to be sitting in a tight loop calculating last Sunday repeatedly, the odds that this additional weight is going to be a problem are rather small; much better to keep the program maintenance as easy as possible. Unless this is a calendaring app for a Palm Pilot... -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]