use Fcntl; sysopen FILE, "copy.txt", O_WRONLY|O_CREAT|O_EXCL or die "Datei existiert bereits: $! "; close FILE;