sub datetring { local(@Time) = localtime(time); $Time[5] += 1900; $Time[4]++; for($i=0;$i<=5;$i++){ $Time[$i] = ($Time[$i] < 10) ? "0$Time[$i]" : "$Time[$i]"; } return "$Time[5]/$Time[4]/$Time[3]"; }