http://www.perlmonks.org?node_id=519221


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