I am using XML::Twig and setting twig_handlers to parse the actual document. The problem I am encountering is that the parser mysteriously dies parsing some relatively simple documents. Below are the handlers being called.

my $handlers = { 'request' => sub { $self->_handler_set_object('request', @_ ) +; # got to here with a warn statement }, $response => sub { $self->_handler_set_object('response', @_ ) +; $self->_object_tree( $response, @_ ) +; # Got to Here, with a warn statement }, }; eval { $self->twig( XML::Twig->new( twig_handlers => $handlers )) +}; croak 'ERROR: ' . $EVAL_ERROR if $EVAL_ERROR; # Got Here eval { $self->twig->parse( $self->get_xml ) }; # Cannot get to here croak 'ERROR: ' . $EVAL_ERROR . qq{\nXML: } . $self->get_xml if $E +VAL_ERROR;

I think the XML parsing engine is blowing up because I never get to the croak error message when it dies. I could upgrade the XML libraries and hope that fixes the problem but I am not familiar with what libraries I would have to update. I like Twig because the code was fairly easy to write, and would rather not have to use something more complex if I can avoid it.

Anyone got any ideas.


In reply to XML::Twig Unexplained Handler dies by Herkum

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.