in reply to Not able to install any module wiht "CPAN" commnad

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

Replies are listed 'Best First'.
Re^2: Not able to install any module wiht "CPAN" commnad
by slayedbylucifer (Scribe) on Mar 29, 2011 at 10:44 UTC

    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

        Hi,

        So I reinstalled XML::LibXML using cpan command and then my script started running fine.

        Thank you all for your quick suggestions.

      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".

        SO I reinstalled XML::LibXML and my script started running. I do not know what difference it made, but yes, its working now.

        Yes, I am able to install other modules with can command. thanks for the pointer. I have changed the subject line.

        I sure need to understand how to confirm a package on cpan website. I presumed everything that has a "::" format is a package and I was wrong.

        Thank you very much to all for your timely and quick inputs..

        SO I reinstalled XML::LibXML and my script started running. I do not know what difference it made, but yes, its working now.

        Yes, I am able to install other modules with can command. thanks for the pointer.

        I sure need to understand how to confirm a package on cpan website. I presumed everything that has a "::" format is a package and I was wrong.

        Thank you very much to all for your timely and quick inputs..

      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