in reply to Warning from XML/Twig.pm : Use of uninitialized value in numeric eq (==)

I think that the problem is with weakrefs. Your system may not be setup to use weaken properly. I put this script together awhile back to make sure that I could handle weaken. Run this, and see if the problem goes away.
#!/usr/local/bin/perl use strict; use warnings; use CPAN; CPAN::Shell->install( "Task::Weaken", "Cache::Weak", "Class::WeakSingleton", "Convert::Scalar", "Data::Structure::Util", "Devel::Cycle", "Devel::Monitor", "Devel::Peek", "EO::WeakArray", "Hash::NoRef", "IO::Plumbing", "Scalar::Util", "Set::Object", "Test::Memory::Cycle", "Test::NoXS", "Test::Weaken", "Tie::RefHash", "Tie::Util", "WeakRef", "WeakRef::Auto", "XML::Parser");
  • Comment on Re: Warning from XML/Twig.pm : Use of uninitialized value in numeric eq (==)
  • Download Code

Replies are listed 'Best First'.
Re^2: Warning from XML/Twig.pm : Use of uninitialized value in numeric eq (==)
by ikegami (Patriarch) on May 13, 2010 at 16:46 UTC

    Your system may not be setup to use weaken properly.

    The ability to weaken references is built into Perl itself, and none of those modules would affect that.

    I believe you are referring to the distro that shipped with a broken Scalar::Util package. It didn't cause weaken to work improperly, it caused the function weaken to throw an exception when used. This is clearly not the OP's problem. (That problem was fixed by simply reinstalling Scalar::Util from source.)

Re^2: Warning from XML/Twig.pm : Use of uninitialized value in numeric eq (==)
by mirod (Canon) on May 13, 2010 at 16:38 UTC

    weaken is normally found in Scalar::Util, so that's the only one that needs to be installed. A long time ago, at least on one version of RedHat, the system Scalar::Util package did not include weaken (the XS part of Scalar::Util, which provides weaken had been ommitted). I don't suppose that is the case here,

    You can check by running this (replace ' by " on windows) :

    perl -e'use Scalar::Util qw/weaken isweak/; use Test::More tests => 2; use strict; use warnings; my $foo; my $ref= \$foo; ok( ! isweak($ref), q{not weak}) ; weaken( $ref); ok( isweak($ref), q{weakened});'