in reply to Combining s///
My take on this matter is somewhat ruled by the philosophy “Dictum Ne Agas: Do Not Do a Thing Already Done.”
“Date manipulation,” of any sort, definitely qualifies as “a thing already done.” Therefore, instead of writing Yet Another One, surf through CPAN and look for any one of a dozen good, highly-rated date manipulation packages. They will imbue your code not only with the ability to do date-comparison (for use with Perl's existing sort-capability), but also the ability to support any date-format. The heavy-lifting has been pushed out of our code and into the purpose-built CPAN routines. Needless to say, they solve the “Y2K problem” in industry-standard accepted ways. It all just works.
Honestly, with so many thousands of great routines out there, your first step in handling almost any problem is to figure out which ready-made solution you can pick off the shelf, whack-on just a few times to get it to do exactly what you want, then just drop-in and use... The fastest way to do any job is to not have to do it at all.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Combining s///
by ack (Deacon) on Mar 10, 2008 at 20:31 UTC |