$string = "2010-10-04 19:34:10"; my ($year, $mon, $day, $hour, $min, $sec) = split(/[-: ]/, $string);