CentOS/RHEL x86_64 + VMWare: Use of uninitialized value in string

I was working with a CentOS 5 x86_64 installation running VMWare server last week when I stumbled upon this error:

Use of uninitialized value in string eq at /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/VMware/VmPerl.pm line 114.

You can run the vmware-cmd application with this error (it’s not a fatal error) and keep going with your normal business. However, if you want to remove the error, comment out lines 114 and 115 in the Perl module referenced by the error:

die "Perl API Version does not match dynamic library version."
    unless (version() eq $VERSION);

Commenting out these lines does not affect the VMWare server in any way.

One Response

  1. This assumption is probably true that this won’t cause any errors. But after patching and upgrading this could come up to haunt you. This is essentially dying because one or both of the two values in evaluation are not defined. A potentially safer way to fix this is to add the following can make a minor change:

    $VERSION = “0″ if(! defined($VERSION));
    my $APIVERSION = version();
    $APIVERSION = “0″ if(! defined($APIVERSION));

    die “Perl API Version does not match dynamic library version.”
    unless ($APIVERSION eq $VERSION);

    Sorry for my randomly nuts rant but this error is one of my biggest pet peeves from maintaining and troubleshooting existing Perl code. It bugs me even more that code like this is distributed and generates all these errors making administrators think that all Perl code is buggy or unstable.

Leave a Reply