eval { code_that_dies; } if ( $@ ne '' ) { code_to_recover_from_code_that_dies; }