use File::Copy qw(move); my $source_path = 'C:\Pfad\irgendwas'; my $source_file = 'filename.txt'; chomp( my $target = ); unless( -e $target ){ move $source_path . '\\' . $source_file, $target; } else{ print "Datei $target schon vorhanden" }