eval { $parser->parse }; if( $@) { my $error= $@; #cleanup }