Top Secret Area!!!

Recommended Sites
xgusties.com
craigmile.com
programming

Perl - XML::Parser bug

I've come accross a bug when using the XML::Parser perl module from CPAN. It's a very annoying bug and no matter how many sites describe it perfectly, none as yet have provided me with a solution.

Symptom:

Can't use string ("<data_block><dt_assoc><item key=") as a symbol ref while "strict refs" in use at /usr/lib/perl5/site_perl/5.6.0/i686-linux/XML/Parser/Expat.pm line 456, <GEN12> line 2.

Cause:

Faulty code in a __DIE__ signal handler clashes with an existing handler to make the error happen.

Solution:

Remove the initial signal handler. In my example. I simply commented out my CGI::Carp qw(fatalsToBrowser) line. Alternatively, upgrade to perl 5.6.1 as the error was fixed here.

Posted: 3rd September 2003