The DateTime module overloads the string/numeric comparison operators ('<=>' and 'cmp'), so if you can get them into DateTime objects instead of strings, you can use a trivial sort operation (my @sorted_dates = sort { $a <=> $b } @unsorted_dates;.
Otherwise, if you store them in DDMMYYYY format, you can do the same thing (or use 'cmp' if you have slashes in the date). Personally, I prefer to use DateTime since I don't want to be constrained by a specific format.
----
send money to your kernel via the boot loader.. This and more wisdom available from Markov Hardburn.
In reply to Re: Sorting Array of dates in PERL
by hardburn
in thread Sorting Array of dates in PERL
by ginju
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |