Help for this page
use re 'debug'; ... map [ $_, join('', (/(..)(..)(....)/)[0,1,2]) ], @dates; # DD-MM-YYYY print "@sorted\n";
Compiling REx `(..)(..)(....)' size 21 Got 172 bytes for offset annotations. ... Match successful! 20130401 20130501 20130601 Freeing REx: `"(..)(..)(....)"'
use warnings; use strict; ... print join ' ' => map{$_->[0]} sort{$a->[1] <=> $b->[1]} map{/.{4}(.{2})/;[$_,$1]} @dates;