my$str= \'4/25/10\';
my$sr = join(\' \',split (/\\//,$str));
#my$s = sprintf \'%3$d %2$d %1$d\',$srt;
print$sr,\"\\n\";
output:
<
Well, a braindead solution might be:
my @date = split( /\//,$str)
printf("%04d-%02d-%02d", $date[2] + 2000, $date[1], $date[0]);
You could write something a little more self-documenting by highlighting what you expect to be year, month and day like so:
my ($day, $month, $year) = split /\//, $str;
printf("%04d-%02d-%02d", $year + 2000, $month, $day);