Skip Menu |
 

This queue is for tickets about the XML-Parser CPAN distribution.

Report information
The Basics
Id: 1868
Status: new
Priority: 0/
Queue: XML-Parser

People
Owner: Nobody in particular
Requestors: paul.macadam [...] intransa.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.31
Fixed in: (no value)



Subject: use strict problem in XML::Parser
Download (untitled) / with headers
text/plain 651b
I'm seeing an error in my SOAP logs regarding XML/Parser/Expat.pm at line 456. I'm using Perl 5.6.1 on a stock RedHat 7.3 box, with XML::Parser 2.31 and SOAP::Lite 0.55. Here's the error: Can't use string ("<?xml version="1.0" encoding="UT") as a symbol ref while "strict refs" in use at /usr/lib/perl5/site_perl/5.6.1/i386-linux/XML/Parser/Expat.pm line 456. Not doing anything special with the SOAP client -- just defining URI and PROXY and calling my service. Have you ever seen this error? Adding no strict refs seems to fix it. Line: 456 eval { no strict 'refs'; $ioref = *{$arg}{IO}; }; Your thoughts? PaulM
From: juerd [...] cpan.org
Download (untitled) / with headers
text/plain 454b
[guest - Wed Dec 11 16:09:26 2002]: Show quoted text
> Adding no strict refs seems to fix it. > > Your thoughts?
My thoughts are that strict complained for a reason and this bug should not have been fixed by disabling strict. Debian seems to have patched their copy using your suggestion, but that introduced a severe memory leak that renders the module unusable in persistent Perl environments. For details, see http://perlmonks.org/index.pl?node_id=251630 -- Juerd
From: paul.macadam [...] intransa.com
Download (untitled) / with headers
text/plain 636b
Since submitting this bug, have learned a lot. Fully agree with you about not disabling strict; I did it because I saw it done elsewhere in the code. As you indicate, it produces all kinds of evilness. The problem, as it turned out, was a die SIG handler in the code that was using XML::Parser. Dies in XML::Parser were getting handled by this handler. That seems unfortunate. The solution was to localize the handler (this was possible because the handler was installed in a subroutine -- don't know what people would do if their SIG handler is global). Anyway, thanks for the response. Anybody reading this: don't disable strict!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.