I found what the issue here is after further consideration. The parse() method is meant to handle both parsing files and strings. If you look at the code that follows that which I included, it tests $ioref to see if there is some kind of filehandle. The line in question (456) is the final attempt to glob a file. The reason that I was seeing it was due to CGI::Carp considering that a fatal error (which the author of Expat.pm doesn't at all). I had to remove the CGI::Carp from the script and handle all my errors myself in an eval{};.
Thanks to everyone who has helped.
BTW, Anonymous Monk, what the heck is absurd about log files being in XML? Works great for me! I can post-process the log file and allow error to be fixed in the browser.
Brian - a.k.a. DrSax
| [reply] [d/l] [select] |
Sorry about the misunderstanding. *If* you could use *only one* node
in a file, *then* it would be absurd to use *that* XML-Implementation
for logfiles. I hope that comes across as intended.
| [reply] |
Everyone is good:-) There was only me. (All Anonymous posts (before this) belong to me).
| [reply] |
I'm not sure that this is an "if all else fails" condition. From what I can see in the calling code (XML::Twig::parse -> XML::Parser::parse -> XML::Expat::parse) the other conditions are there to handle more specialized cases. The first condition handles the case where a filehandle has been passed in as the argument, the second handles a Tied Handle, and the third is there to handle a simple scalar which contains the string to be parsed. Apologies to Larry and Clark if I have misunderstood their code...
If you read what I wrote closely you will see that this code works fine from the command line. It is in the browser that this error occurs.
| [reply] |
I'm not sure it's commandline vs CGI. I think it's testcase
(with 1 node) vs the real thing (with many nodes) in the string.
| [reply] |
The 3rd case handles an open HALLO handle.
| [reply] [d/l] |