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