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

Hello Monks, I am new here, but I do like perl a lot.
help me out
I have a problem with my VMWare ESX 3.0.1 perl installation.
By accident we installed(compiled) perl 5.8.0 with the -de
(default options) and now some scripts do not work anymore like
vmware-cmd, it gives error:
Can't locate VMware/VmPerl.pm in @INC (
/usr/bin/vmware-cmd requires the VMware::VmPerl Perl libraries to be installed.
I have tried copying the file it requires to a lib location, but it wont work.
So should I recompile perl?
By doing perl -V in other server I saw many different parameters.
Is there a way to get the Config from one server and compile using that?

Can I easly reinstall modules by just using the .pm files, how?
btw.My CPAN is not working...
thanks in advance,

Replies are listed 'Best First'.
Re: Compile Perl , add library?
by jethro (Monsignor) on May 29, 2009 at 17:40 UTC

    I have no knowledge about the vmware installation, but if you have more than one of these installations you might just copy perl and its libraries from the working installation.

    Having said that, your error message shouldn't be a problem to fix. Obviously vmware uses a homegrown library which it doesn't search for in the usual locations.

    So find the place VmPerl.pm is in the other machines (find / -name VmPerl.pm -print) and try to replicate that. Or see if the environment variables PERL5LIB or PERLLIB are set to something when the vmware scripts are run

    Or set the PERL5LIB variable yourself to point to where you put VMware/VmPerl.pm.

    By the way, when you tried to copy VmPerl.pm to a lib location, did you put it in a directory called VMware? If not you produced a library VmPerl instead of VMware::VmPerl the script was looking for

      Thank you for your reply.
      I tried coping it already, but I get anothe error msgs.
      Should I reinstall verion 5.6.0?
      Anyone knows how to clean uninstall Perl?
      Or duplicate an existing perl installation to another server?

      I have VmPerl.pm at:
      /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/VMware/VmPerl.pm
      and
      /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/VMware/VmPerl.pm

      with perl -V cmd I can see the @INC like:
      @INC:
      /usr/local/lib/perl5/5.8.0/i686-linux
      /usr/local/lib/perl5/5.8.0
      /usr/local/lib/perl5/site_perl/5.8.0/i686-linux
      /usr/local/lib/perl5/site_perl/5.8.0
      /usr/local/lib/perl5/site_perl

      The original error is gone, now the error is:
      Can't locate auto/VMware/VmPerl/autosplit.ix in @INC (@INC
      contains: blib/arch -Iblib/lib -I/usr/lib/perl5/5.6.0
      /i386-linux -I/usr/lib/perl5/5.6.0 -I. /usr/local/lib/perl5/5.8.0/i686-linux /usr/local/lib/perl5/5.8.0
      /usr/local/lib/perl5/site_perl/5.8.0/i686-linux /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5
      /site_perl . blib/arch blib/lib /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 .) at /usr/local
      /lib/perl5/5.8.0/AutoLoader.pm line 158.
      at /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/VMware/VmPerl.pm line 12

      Can't locate loadable object for module VMware::VmPerl in @INC (@INC contains: blib/arch -Iblib/lib -I/usr/lib/perl5/5.6.0/i386-linux -I/usr/lib/perl5/5.6.0 -I. /usr/local/lib/perl5/5.8.0/i686-linux /usr/local/lib/perl5/5.8.0
      /usr/local/lib/perl5/site_perl/5.8.0/i686-linux /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5
      /site_perl . blib/arch blib/lib /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 .) at /usr/bin
      /vmware-cmd line 133

      Compilation failed in require at /usr/bin/vmware-cmd line 133.
      /usr/bin/vmware-cmd requires the VMware::VmPerl Perl libraries to be installed.
      Check that your installation did not encounter errors.

        The error message means the module also has compiled c-code which is probably stored in the directory VMware too. You might try one of the following:

        a) If I understand you correctly, you had perl5.6.0 on the machine before you installed the other perl? If yes, the old installation should be still there. Perls of different versions can coexist on one machine.

        Look into /usr/lib/perl5/5.6.0. If there are files, your old libraries are still there. Look into /usr/bin/. Is there still a file perl5.6.0 in there, everything is still in place, you are just using the wrong perl. In that case 'rm /usr/local/bin/perl' (you can still use this new version with '/usr/local/bin/perl5.8.0' after this).

        Make sure /usr/bin/perl is the exact same size as /usr/bin/perl5.6.0, otherwise do 'rm /usr/bin/perl; ln /usr/bin/perl5.6.0 /usr/bin/perl'. Everything should work again

        b) If you never had perl5.6.0 on the machine you might copy it from one of the other vmwares:
        Copy all the files in /usr/lib/perl5 recursively (for example using 'scp -rp')

        Then copy the following files from /usr/bin: perl5.6.0 perl xsubpp splain shasum s2p ptardiff ptar pstruct psed podselect podchecker pod2usage pod2text pod2man pod2latex pod2html pl2pm piconv perlivp perldoc perlbug libnetcfg instmodsh h2xs h2ph find2perl enc2xs dprofpp cpanp-run-perl cpanp cpan2dist c2ph a2p imgsize ysh . If you don't have some of them on the source machine, no problem, I made that list from my perl10.0 installation, there might have been changes between these versions. The most important file is 'perl', you might not need most or all of the rest for the operation of the vmware scripts.

        If the machine you are copying from is similar enough to the target machine (i.e. obviously you can't use a sparc or powerpc machine to copy to a x86 machine since there are executables involved) this should work now.