Re: mod_perl and XML::LibXML
[prev]
[thread]
[next]
[Date index for 2005/03/18]
On Thu, 17 Mar 2005, Stas Bekman wrote:
> James Orr wrote:
>> Hi,
>>
>> I have an occaisional error happening with a module i'm using from a
>> mod_perl script. This is in my "new" method ...
>>
>> my $ifh = IO::File->new($project_dir.'/info.xml') || die "Can't open
>> info file: $!";
>> $data->{'info'} = $parser->parse_fh($ifh);
>>
>> And the error it gives is ...
>>
>> read on filehandle failed: Can't use an undefined value as a symbol
>> reference at /usr/lib/perl5/site_perl/5.8.4/i686-linux/XML/LibXML.pm
>> line 336.
>>
>> By occaisional I mean that this error has occured 21 times in over
>> 21,000 hits.
>
> James, assuming that you don't use any eval {} blocks, try to install:
>
> use Carp;
> $SIG{__DIE__} = \&Carp::confess;
>
> (e.g. at the startup or your script)
>
> so the next time it fails you will see the exact calls trace. You can further
> expand that sighandler to dump more information to figure out what triggers
> the problem, helping you to define a reproduceable at will test program which
> can them be easily solved.
Stas does have a good recommendation here, so please don't discount it. I
should point out the XML::LibXML module can read directly from a file. Is
there a specific reason why you don't use that method? Search for the
parse_file( $filename ) method. I am interested in seeing if a specific
problem exists in the XML::LibXML module though as it is a module I
generally track and use quite often. Currently it is using methods that
are deprecated in the C library and it needs to be transitioned to a new
logic. As time permits of course ...
//========================================================\\
|| D. Hageman <dhageman@xxxxxxx.xxx> ||
\\========================================================//