in reply to Parsing with SAX an XML Document with no Root Node

Why is adding a root tag around the data (which is not XML BTW, as it does not parse) not an option? You could use a pipe or create a temp file to hold the real XML.:

open( XML, qq{echo "<doc>" cat $file echo "</doc>" |}) or die "could not open file: $!"; $p->parse( \*XML);

BTW, XML::Parser is not a SAX parser, see XML::SAX::Intro for more details.