my $ret = system("cp $datei $zielverzeichnis"); if ($ret != 0 { if ($? == -1) { print "execute failed with $!\n"; } elsif ($? & 127) { printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; } else { printf "child exited with value %d\n", $? >> 8; } }