in reply to XML-Twig

Works perfectly well for me. This is what I get after I run my example (yours modified)
DON't LEAVE OUT RELEVANT INFORMATION

XML::Twig::VERSION 3.04
XML::Parser::VERSION 2.31
XML::Parser::Expat::VERSION 2.31


 ... EEEEEEEEEEEEEEEEEEEEEEEKKKKK  ...
use XML::Parser; use XML::Parser::Expat; use XML::Twig; $\="\n"; print "DON't LEAVE OUT RELEVANT INFORMATION\n"; print "XML::Twig::VERSION $XML::Twig::VERSION"; print "XML::Parser::VERSION $XML::Parser::VERSION"; print "XML::Parser::Expat::VERSION $XML::Parser::Expat::VERSION\n"; my $t = XML::Twig->new( twig_roots => { '/node/data/field' => \&print_elt_text } ); $t->parse( \*DATA ); sub print_elt_text { my( $t, $elt ) = @_; print $elt->text; $t->purge; } __DATA__ <?xml version="1.0" encoding="ISO-8859-1"?> <node id="193032" title="XML-Twig" > <type id="115"> perlquestion</type> <author id="961"> Anonymous Monk</author> <data> <field name="doctext"> ... EEEEEEEEEEEEEEEEEEEEEEEKKKKK ... </field> </data> </node>
I suggest removing XML::Parser and XML::Twig completely and reinstalling ( something gone bad).

____________________________________________________
** The Third rule of perl club is a statement of fact: pod is sexy.