Dear Monks,

This script:

use strict; use warnings; use 5.010; use XML::Simple; my $str= '<abc><nested>hello</nested></abc>'; my $xml = XMLin($str);

gives me this error:

Can't load '/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/auto/X +ML/LibXML/LibXML.bundle' for module XML::LibXML: dlopen(/usr/local/li +b/perl5/site_perl/5.10.1/darwin-2level/auto/XML/LibXML/LibXML.bundle, + 1): Symbol not found: _PL_na Referenced from: /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level +/auto/XML/LibXML/LibXML.bundle Expected in: dynamic lookup at /usr/local/lib/perl5/5.10.1/darwin-2level/DynaLoader.pm line 153 BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +10.1/darwin-2level/XML/LibXML.pm line 153. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.10.1 +/darwin-2level/XML/LibXML/SAX.pm line 17. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +10.1/darwin-2level/XML/LibXML/SAX.pm line 17. Compilation failed in require at (eval 3) line 1.

I thought I installed XML::Simple, so I tried this:

cpan[4]> recent Constant subroutine XML::LibXML::XML_XMLNS_NS redefined at /usr/local/ +lib/perl5/5.10.1/constant.pm line 115, <FIN> line 4. Constant subroutine XML::LibXML::XML_XML_NS redefined at /usr/local/li +b/perl5/5.10.1/constant.pm line 115, <FIN> line 4. Subroutine VERSION redefined at /usr/local/lib/perl5/site_perl/5.10.1/ +darwin-2level/XML/LibXML.pm line 37, <FIN> line 4. no XML::LibXML installed, cannot continue

Ok, so I tried this:

cpan[5]> install XML::LibXML XML::LibXML is up to date (1.70).

Huh?

cpan[6]> recent Constant subroutine XML::LibXML::XML_XMLNS_NS redefined at /usr/local/ +lib/perl5/5.10.1/constant.pm line 115, <FIN> line 6. Constant subroutine XML::LibXML::XML_XML_NS redefined at /usr/local/li +b/perl5/5.10.1/constant.pm line 115, <FIN> line 6. Subroutine VERSION redefined at /usr/local/lib/perl5/site_perl/5.10.1/ +darwin-2level/XML/LibXML.pm line 37, <FIN> line 6. no XML::LibXML installed, cannot continue

Can anyone tell me what the problem is?


In reply to XML::Simple problems by 7stud

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.