<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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |