slayedbylucifer has asked for the wisdom of the Perl Monks concerning the following question:

I installed "cpan" command on my fedora 14 but not able to install module "XML::LibXML::Document". Here is the error:

# cpan -i XML::LibXML::Document Going to read '/root/.cpan/Metadata' Database was generated on Tue, 29 Mar 2011 07:39:26 GMT Warning: Cannot install XML::LibXML::Document, don't know what it is. Try the command i /XML::LibXML::Document/ to find objects with matching identifiers.

Above module is available on CPAN website. Can someone help me with this issue.

Thanks.

Replies are listed 'Best First'.
Re: Not able to install any module wiht "CPAN" commnad
by Anonymous Monk on Mar 29, 2011 at 10:31 UTC
    Well, to be fair, XML::LibXML::Document doesn't exist as a module (use XML::LibXML::Document; will fail), but the good news is that XML::LibXML does exist as a module, so try to install XML::LibXML instead

      Thanks for the lightning fast reply. I am new to perl and hence this is what I am trying to do.

      I am running Vmware perl SDK and not able to tun any of the scripts as it throws following error:

      Use of inherited AUTOLOAD for non-method XML::LibXML::Document::docume +ntElement() is deprecated at /usr/share/perl5/VMware/VICommon.pm line + 548. Undefined subroutine &XML::LibXML::Document::documentElement called at + /usr/share/perl5/VMware/VICommon.pm line 548

      I did some googling and came across XML::LibXML::Document on CPAN @ http://search.cpan.org/~pajas/XML-LibXML-1.70/lib/XML/LibXML/Document.pod and this page does contain references to "Document::documentElement" and hence I thought may be i should try installing that module

      Well, I could not figure out that it is not a module in fact.

      BTW, I do have XML::LibXML on my fedora but still my VMware perl scripts are failing with above mentioned error

      Thanks.

        That is the name of a module inside XML-LibXML, which is the distribution. When you install XML::LibXML either way, you'll get XML::LibXML::Document, meaning it's already installed on your machine.

        Question is, why don't perl see it. Since the name VMWare has been mentioned, I tend to assume you might be running it from a Virtual session inside your Fedora, which might not have this module installed. But there could be other reasons. More details on your environment might help.

        Principle of Least Astonishment: Any language that doesn’t occasionally surprise the novice will pay for it by continually surprising the expert

        XML::LibXML::Document is strange and I can understand why you might be confused!

        It exists as a package in XML::LibXML, and not in its own file. There is also a XML::LibXML::Document *documentation* file. Note that in that documentation the example code is ...

        use XML::LibXML; # <--- $dom = XML::LibXML::Document->new( $version, $encoding );

        You can't use XML::LibXML::Document because there's no file to load.

        I presume that you can install other modules though (ones that actually exist as modules!) so you should probably change the title of your post to something like "can't load XML::LibXML::Document".

        BTW, I do have XML::LibXML on my fedora...

        Apparently this might be a problem with libxml-libxml-perl, which you need to remove/reinstall with apt

Re: Not able to install any module wiht "CPAN" commnad
by Anonymous Monk on Mar 29, 2011 at 14:49 UTC
    Also be mindful of case-sensitivity ... not in this case but in-general. For instance, "VMWare" and "Vmware" are not the same string, although (say, Windows) would treat them as the same (say) file name. Takes some getting used to, depending on which world you're coming from.