in reply to sort strings by date

The easiest way I have found to do this is to turn the date and time string into a number. Split the string into day,month,year,hours,minutes,seconds and then feed that into the timelocal function from Time::Local. This will give a number that is easily sorted.
Here is a bit of code that describes this somewhat ugly and perhaps not very efficient routine:
#!/usr/bin/perl -w use strict; use Time::Local; my $test = "G: CCCCC-01 :ADD : ORDER PROCESSED : *** OK ***:08/30/2003 +:14:24:58"; my $datetemp = substr($test,index($test,"***:")+4,length($test)-index( +$test,"***:")+4); print "DATE & TIME: $datetemp\n"; my $date = substr($datetemp,0,index($datetemp,":")); print "DATE ONLY: $date\n"; my $time = substr($datetemp,index($datetemp,":")+1,length($datetemp)-i +ndex($datetemp,":")); print "TIME ONLY: $time\n"; my @datearray = split(/\//,$date); my @timearray = split(/:/,$time); my $ticks = timelocal($timearray[2],$timearray[1],$timearray[0],$datea +rray[1],$datearray[0]-1,$datearray[2]); print "CLOCK TICKS SINCE THE EPOCH: $ticks\n"; #usage of the timelocal function # my $time = timelocal($sec,$min,$hour,$mday,$month,$year);
Again, this is somewhat ugly but it gets the job done in manner that is easy to understand. There is really no need to assign the variables $date and $time, I just thought it would make it easier to understand the process.