Parsing a file handle with XML::Twig

540 Views Asked by At

I see in the XML::Twig documentation the functions parse($text) for parsing scalars contain xml text, and parsefile($fileName) for reading in and parsing xml files. I would like to parse an input stream (a file handle or maybe STDIN). Still wading through documentation and haven't found anything. How should I do this?

1

There are 1 best solutions below

1
On BEST ANSWER

XML::Twig is a subclass of XML::Parser, so you should be able to pass parse() an open IO::Handle.