Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

sorting a file by a date:"YYYY-MM-DD" field with cmp

by jason.printer (Initiate)
on Jun 16, 2015 at 17:31 UTC ( [id://1130647]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub sortByDate
    {
    ...
    
     return ($aDate cmp $bDate);
    }
    
  2. or download this
    { date:"2015-03-01", content:"asdf" }
    
    ...
    { date:"2015-01-02", content:"erts" }
    
    { date:"2014-04-02", content:"w34r" }
    
  3. or download this
    #!/user/bin/perl
    use strict;
    ...
    2015-05-01
    2015-01-02
    2014-04-02
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1130647]
Approved by davido
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-24 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found