broquaint has asked for the wisdom of the Perl Monks concerning the following question:
Now, exactly the same code with the $SIG{__DIE__} line commented out produces the expecteduse XML::Simple; use Data::Dumper; use strict; # note - added exit(1) to keep things simple $SIG{__DIE__} = sub { print "$_[0]"; exit(1) }; my $xml_str = <<XML; <tag1> <tag2 attr1="foo" /> </tag1> XML my $ret = XMLin($xml_str); print Dumper($ret); __output__ Can't use string ("<tag1> <tag2 attr1="foo" /> </t") as a symbol ref while "strict refs" in use at /usr/lib/p +erl5/site_perl/5.6.0/i386-linux//XML/Parser/Expat.pm line 456.
I've tested this code with perl 5.6.0 and 5.6.1 using the latest versions of both XML::Simple and XML::Parser on Linux and Solaris.$VAR1 = { 'tag2' => { 'attr1' => 'foo' } };
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Simple conflicts with $SIG{__DIE__}
by perrin (Chancellor) on Apr 17, 2002 at 19:20 UTC | |
by Matts (Deacon) on Apr 18, 2002 at 13:43 UTC | |
by broquaint (Abbot) on Apr 18, 2002 at 13:23 UTC |