my$str= \'4/25/10\'; my$sr = join(\' \',split (/\\//,$str)); #my$s = sprintf \'%3$d %2$d %1$d\',$srt; print$sr,\"\\n\";
output:
use DateTime::Format::Strptime; my $strp = DateTime::Format::Strptime->new( pattern => '%m/%d/%y', locale => 'en_US' ); my $dt = $strp->parse_datetime('4/25/10'); print $dt->strftime('%Y-%d-%m'), "\n";
Gives:
2010-25-04