Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: eval not catching XML Parser die

by agoth (Chaplain)
on Jun 24, 2002 at 15:18 UTC ( [id://176826]=note: print w/replies, xml ) Need Help??


in reply to eval not catching XML Parser die

Oh dear, oh dear,

Sorry, my debugging / problem searching ability seems to have deserted me on this one.

the base problem can be isolated on a much simpler script

It segfaults on linux under 5.6.1

It doesnt segfault on Solaris with perl 5.00503

use strict; use XML::Simple; for ('./news-arabic-business.xml') { my $xmlfile = $_; my $struct; my $parser = new XML::Simple( forcearray => 1 ); eval { $struct = $parser->XMLin( $xmlfile ); die "wibble " unless ref $struct eq 'HASH'; }; if ($@) { print "$@ \n"; next; }; }
where all the xml file has to contain is

< ?xml version="1.0" encoding="Windows-1256"? >

on Solaris the modules are older versions.

Replies are listed 'Best First'.
Re: Re: eval not catching XML Parser die
by grantm (Parson) on Jun 24, 2002 at 15:50 UTC

    Here's my reduced test case:

    use strict; use XML::Simple; my $xml = q(<?xml version="1.0" encoding="Windows-1256"?> <stuff>nope</stuff> ); my $ref = eval { XMLin( $xml ) }; print $@ if($@); print "About to exit\n"; #exit(0);

    Notice the 'exit(0)' line is commented out. If you remove the '#', the segfault goes away (Linux, Perl 5.6.1).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://176826]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-20 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found