|Perl: the Markov chain saw|
Re^3: Parsing HTML/XML with Regular Expressions (XML::Twig)by Discipulus (Monsignor)
|on Oct 17, 2017 at 19:45 UTC||Need Help??|
You presumed ~right about DATA filehandle.
The xmltwig.org and docs specify parse $string or \*OPEN_FILEHANDLE among twig's methods.
So you are right: I had to pass an handle not an iterator (?) like <DATA>
So $twig->parse(<DATA>) does not works with your example but i can confirm that passing the filehandle $twig->parse(\*DATA) or even $twig->parse(*DATA) works as expected.
Can be that wrong form works (at least sometimes) because of the XML::Twig ability to parse streams of XML?
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.