Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: After compiling a script using PAR::Packer I get the error Can't locate XML/LibXML/SAX.pm in @INC

by ikegami (Patriarch)
on May 15, 2015 at 18:14 UTC ( [id://1126802]=note: print w/replies, xml ) Need Help??


in reply to Re: After compiling a script using PAR::Packer I get the error Can't locate XML/LibXML/SAX.pm in @INC
in thread After compiling a script using PAR::Packer I get the error Can't locate XML/LibXML/SAX.pm in @INC

$XML::Simple::PREFERRED_PARSER = 'XML::Parser';
would be more straightforward and less error-prone than
$ENV{XML_SIMPLE_PREFERRED_PARSER} = 'XML::Parser';

Whichever method you use, it doesn't need to be done before the module is loaded; just before XMLin is called. Safer:

use XML::Simple qw( XMLin ); sub parse_xml { local $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; return XMLin(@_); } my $xml = parse_xml(...);
  • Comment on Re^2: After compiling a script using PAR::Packer I get the error Can't locate XML/LibXML/SAX.pm in @INC
  • Select or Download Code

Replies are listed 'Best First'.
Re^3: After compiling a script using PAR::Packer I get the error Can't locate XML/LibXML/SAX.pm in @INC
by Anonymous Monk on May 15, 2015 at 23:18 UTC

    would be more straightforward and less error-prone than

    Nonsense

    Whichever method you use, it doesn't need to be done before the module is loaded; just before XMLin is called.

    true

    Safer:

    Nonsense

      If you think it doesn't matter which parser is used, you've been lucky or you haven't used XML::Simple much. You don't have to be an asshole about it.

        If you think it doesn't matter which parser is used, you've been lucky or you haven't used XML::Simple much. You don't have to be an asshole about it.

        There is no difference in regards to "safety" if the op sets the preffered parser via $ENV{XML_SIMPLE_PREFERRED_PARSER} or via $XML::Simple::PREFERRED_PARSER , they're both equally safe

        Equally neither is more or less error prone than the oper, especially since the op is using PAR::Packer

        For such a hyper pedant you sure have a flare for saying nonsense and being rude when you're called on it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1126802]
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-19 12:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found