eval { ... code ... }; ... code ... if ( $@ ) { print "Fehler!"; }