my $error = funktion(); $error and print($error) and exit(1); ... weiter im Programm