Okay - I have gotten your code to work, and to do what I want. Now this may be a beginners question - but:
How on earth do I get XML::Twig's parse function to use the iterator instead of a filehandle?
my $inputHandle = create_iterator(); $t->parse (<$inputHandle>);
exits with error message "Not a GLOB reference at ./script.pl line xy.".
And
$t->parse ($inputHandle);
spits out: "not well-formed (invalid token) at line 1, column 4, byte 4 at /usr/lib/x86_64-linux-gnu/perl5/5.20/XML/Parser.pm line 187. at ./script.pl line xy."
So how do I typecast the iterator in order to treat it like a file handle?
In reply to Re^4: peek at STDIN, to determine data type and then pass STDIN to a parser
by aral
in thread peek at STDIN, to determine data type and then pass STDIN to a parser
by aral
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |