[Omaha.pm] Sort quickie

Mike Hostetler hostetlerm at gmail.com
Mon Jul 12 10:48:43 CDT 2004


On Sat, 19 Jun 2004 00:14:02 -0500, Jay Hannah <jay at jays.net> wrote:
> 
> I had a bunch of hash keys that were dates in MMDDYYYY format. I wanted
> to get a sorted list of the keys. Perl to the rescue! Have y'all
> configured custom sort subroutines before? They're cool...
[snip]

Concerning parsing dates . .. I just discovered a nifty module in CPAN
called Date::Manip that will parse anything -- just dangle anything
that resembles a date around it, and it will figure it out.

>From perldoc Date::Manip:

         $date = ParseDate("today");
         $date = ParseDate("1st thursday in June 1992");
         $date = ParseDate("05/10/93");
         $date = ParseDate("12:30 Dec 12th 1880");
         $date = ParseDate("8:00pm december tenth");


-- 
Mike Hostetler
thehaas at binary.net
http://www.binary.net/thehaas



More information about the Omaha-pm mailing list