Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Sorting The Date format Values without using any perl modules.

by fishbot_v2 (Chaplain)
on Dec 26, 2005 at 22:52 UTC ( #519221=note: print w/ replies, xml ) Need Help??


in reply to Sorting The Date format Values without using any perl modules.

use strict; use warnings; my @list = ( '2005-12-01' , '2005-11-02' , '2005-12-07'); my @sorted = map { $_->[3] } sort { $a->[0] <=> $b->[0] || $a->[1] <=> $b->[1] || $a->[2] <=> $b->[2] } map { [ unpack( 'A4 x[A] A2 x[A] A2', $_ ), $_ ] } @list;

Your restrictions are beyond baffling.


Comment on Re: Sorting The Date format Values without using any perl modules.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (11)
As of 2014-09-19 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (143 votes), past polls