#!/usr/local/bin/perl

use Date::Parse;

push @array, 'Thu, 5 Feb 2004 12:39:12 -0500';
push @array, 'Fri, 6 Feb 2004 14:56:24 -0500';
push @array, 'Sat, 7 Feb 2004 03:28:04 -0500';
push @array, 'Wed, 4 Feb 2004 15:14:26 -0500';
push @array, 'Fri, 6 Feb 2004 01:22:38 -0500';
push @array, 'Sun, 8 Feb 2004 12:49:51 -0500';
push @array, 'Fri, 9 Jun 2004 11:11:23 -0500';
push @array, 'Tue, 1 Jan 2004 11:11:23 -0500';

# year, month, daynumber, time
# [3], [2], [1], [5]

my $i = 0;
my @sorted = map $array[substr($_,4)],
 sort map pack('N',str2time($_)).$i++, @array;

foreach(@sorted){
	print "$_\n";
}
