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.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Printed from: http://rackerhacker.com/2008/09/03/centosrhel-x86_64-vmware-use-of-uninitialized-value-in-string/ .
© Major Hayden 2010.

2 Comments   »

  • BigJoe says:

    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.

  • Andy says:

    Thanks BigJoe.

    Watch out though, folks. The text above includes those pesky 'smart double quotes', not real double-quotes, so you'll need to replace the incorrect double-quotes with correct ones when you paste this snippet in to the Perl module.

RSS feed for comments on this post , TrackBack URI

Leave a Reply