if( $@ =~ /some error stuff/ ) { warn "error stuff occurred"; } else { warn "some other message" ; } #### if($@) { Oops; }