my $today = 20050622; my ($y, $m, $d) = $today =~ /(\d){4}(\d){2}(\d){2}/; print join ":", $y, $m, $d; # prints 5:6:2, not 2005:06:22