Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: sorting dates in YYYYMMDD format

by learner@perl (Novice)
on Jul 04, 2013 at 07:17 UTC ( #1042351=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    @dates = ('20130601', '20130401', '20130501');
    my @sorted =
    ...
       map [ $_, join('', (/(..)(..)(....)/)[0,1,2]) ],
       @dates;  # DD-MM-YYYY
    print "@sorted\n";
    
  2. or download this
    20130401 20130501 20130601
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1042351]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2015-07-30 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls