in reply to Re^3: peek at STDIN, to determine data type and then pass STDIN to a parser
in thread peek at STDIN, to determine data type and then pass STDIN to a parser
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: peek at STDIN, to determine data type and then pass STDIN to a parser
by MidLifeXis (Monsignor) on Jan 09, 2015 at 17:48 UTC | |
by aral (Acolyte) on Jan 12, 2015 at 13:54 UTC | |
by aral (Acolyte) on Feb 17, 2015 at 11:44 UTC |