I'm using XML::Parser::Lite on AIX 5.0.0.0 and working with the following document:
<foo/>

I can do the following:

use strict; use warnings; use XML::Parser::Lite; my $doc = "<foo/>\n"; print "'$doc'\n"; my $parser = XML::Parser::Lite->new( Handlers => { Start => sub { shift; print "Start: @_\n"; }, Char => sub { shift; print "Char: @_\n"; }, End => sub { shift; print "End: @_\n"; }, }, ); $parser->parse($doc); print "Finally done\n"; -------- '<foo/> ' Start: foo End: foo Finally done

But, the following code produces a different error (sometimes in a different place), depending if I use perl5.6.0, perl5.8.0, or perl5.8.1:

Foo/Bar.pm package Foo::Bar; sub new { bless {} } 1; __END__ ---- main.pl use strict; use warnings; use XML::Parser::Lite; my $doc = "<foo/>\n"; print "'$doc'\n"; my %Names = ( foo => 'Foo::Bar', ); my @stack; my $parser = XML::Parser::Lite->new( Handlers => { Start => sub { shift; print "Start: @_\n"; my $pkg = shift; (my $name = $Names{$pkg}) =~ s!::!/!g; $name .= '.pm'; eval { require $name; }; if ($@) { die "Cannot require '$name' ($pkg)\n"; } my $x = $Names{$pkg}->new(@_); push @stack, $x; }, End => sub { shift; print "End: @_\n"; pop @stack if @stack; }, }, ); $parser->parse($doc); print "Finally done\n";

Under 5.6.0, it says:

'<foo/> ' Start: foo 50356: terminated with signal 4 -- core dumped

Under 5.8.0, it says:

'<foo/> ' Start: foo 13000: terminated with signal 11 -- core dumped

Under 5.8.1, it goes farther and says:

'<foo/> ' Start: foo End: foo corrupted regexp pointers at (eval 1) line 1.

I am stumped. I can't use XML::Parser because I can't install expat on this machine. Help!

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

... strings and arrays will suffice. As they are easily available as native data types in any sane language, ... - blokhead, speaking on evolutionary algorithms

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.


In reply to XML::Parser::Lite coredumping by dragonchild

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.