The above suggestions are correct for just sorting dates, but if you need to know the difference between dates you need to use another approach:
Lowlevel approach:
You can use
POSIX's strftime() function Time::Local's timelocal() function to convert dates to epoch seconds, and substract them, but if you need to convert the difference in seconds back to anything more complicated than 24 hour days, you probably need something more high-level.
use CPAN
You can also take a look at the (literally) hundreds of
CPAN date modules. One you can probably use is
Date::Calc.
Joost
update: finally found the right standard module to convert back from localtime.
--
#!/usr/bin/perl -np
BEGIN{@ARGV=$0}s(^([^=].*)|=)()s;
=Just another perl hacker\