in reply to use of date n time functions
to get the components of your string (having made a guess at what these components are, of course).my ($weekday, $month, $day, $hours, $minutes, $seconds, $whatever) = s +plit /[_:]/, 'mon_jan_01_16:00:33_t23.96-d568'
Then have a look at Time::Local which can transform the above components (hint: the name of the month must still be transformed into its sequence number) of your date-time string into the number of seconds since the epoch. It is then very easy to sort according to that number.
One difficulty you will have to surmount is the missing year in your date-time string. Perhaps you can assume it is always the present year?
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|