# get the current date to append to output filename my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); my $cyear = $year+1900; my $cmonth = $mon+1; if ( $cmonth < 10 ) {$cmonth = "0" . $cmonth;} my $cday = $mday; if ( $cday < 10 ) { $cday = "0" . $cday; } my $cdate = "_$cday" . "_$cmonth" . "_$cyear"; $txtfileout = "permrestore" . $startdir . $cdate;