# [...] if( -e $file ){ my ($d,$m,$y) = (localtime time)[3..5]; my $date = sprintf "%02d%02d%04d", $d,$m+1,$y+1900; my $new = 'tttt' . $date . '.bak'; copy $file, $new; unlink $file if -e $new; } # [...]