I'm relatively new to Perl, writing some XML parsing scripts. I have done two successfully, and this is my third one. I am running into issues which I think are tied to the XML document being ASCII encoded.
I am using Fedora 14 with httpd/apache/perl
I do have
use CGI::Carp qw(fatalsToBrowser);
in my web script, so I do see errors on the web page, for the most part, but for the following error, I am not seeing any error on the screen except the generic Apache "500 internal server error," and the httpd error log simply states "Premature end of script headers"
Here is the gist of the code:
my $cparser = new XML::DOM::Parser;
my $refdoc = $cparser->parse($cfile, ProtocolEncoding => 'US-ASCII');
findmynodes $refdoc;
...
sub findmynodes
{
my @refnode = $_0->findnodes("/conf:ConfModel");
...
I'm sure $_[0] OK, because if I print $_0 to a file I see "XML::DOM::Document=ARRAY(0x8bb65b8)"
I'm also sure findnodes is the culprit. Event if I do findnodes("//*") it fails.
Does anybody know what the issue could be? How can I find more info on what is failing?
Thanks,
Eric
$_[0]or$_0?$_0is not the same thing as$_[0], it's just the scalar variable$_0.use strict;would tell you that. - mirod