#! perl use strict; my $s = "19600623"; my $yy = substr($s, 0, 4); my $mm = substr($s, 4, 2); my $dd = substr($s, 6, 2); print "$yy-$mm-$dd\n";