Skip Menu |

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

Report information
The Basics
Id: 3325
Status: resolved
Priority: 0/
Queue: XML-Simple

People
Owner: Nobody in particular
Requestors: jkeroes [...] gmail.com
Cc:
AdminCc:

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



Subject: Fails CPAN.pm install when neither XML::SAX nor XML::Parser are present
CPAN.pm won't install XML::Simple onto a system without either XML::SAX or XML::Parser. It fails silently - the print()s in Makefile.PL are filtered by CPAN.pm - preventing the user from seeing them. Recommend you try something like the following in Makefile.PL: if ( eval { require XML::Parser } && $@ == 0 ) { WriteMakefile( PREREQ_PM => { XML::Parser => 0, XML::NamespaceSupport => 1.04 }, ... ); } elsif ( eval { require XML::SAX } && $@ == 0 ) { WriteMakefile( PREREQ_PM => { XML::SAX => 0, XML::NamespaceSupport => 1.04 }, ... ); } else { # XML::Parser or XML::SAX? You decide. WriteMakefile( PREREQ_PM => { XML::Parser => 0, XML::NamespaceSupport => 1.04 }, ... ); } Thanks - let me know if you need more detail, Joshua
$@ will be '' when eval { require Module } succeeds, not 0. # Better if ( eval { require XML::Parser } && ! $@ ) { WriteMakefile( PREREQ_PM => { XML::Parser => 0, XML::NamespaceSupport => 1.04 }, ... ); } elsif ( eval { require XML::SAX } && ! $@ ) { WriteMakefile( PREREQ_PM => { XML::SAX => 0, XML::NamespaceSupport => 1.04 }, ... ); } else { # XML::Parser or XML::SAX? You decide. WriteMakefile( PREREQ_PM => { XML::Parser => 0, XML::NamespaceSupport => 1.04 }, ... ); }
Version 2.09 of XML::Simple includes a Makefile.PL based on your suggestions - thanks.