in reply to Re^2: CPAN and "Weak references"
in thread CPAN and "Weak references"

You might additionally want to check whether Util.so is in fact being loaded:

$ strace -efile perl -MScalar::Util=weaken -e'weaken(\my $var)' 2>&1 | + grep Util\.so

With a working installation, the results should look something like

stat("/usr/lib/perl5/5.8.8/auto/List/Util/Util.so", 0x63b140) = -1 ENO +ENT (No such file or directory) stat("/usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/auto/List/Util/Ut +il.so", {st_mode=S_IFREG|0555, st_size=40616, ...}) = 0 open("/usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/auto/List/Util/Ut +il.so", O_RDONLY) = 6

Otherwise, you'd get stat()s with ENOENT only (several dozens, typically), or maybe an attempted open() with EACCES (Permission denied), but no successful open()

Replies are listed 'Best First'.
Re^4: CPAN and "Weak references"
by arthurg (Acolyte) on Dec 07, 2009 at 23:37 UTC

    Fantastic diagnosis almut and Corion! Reinstalling Scalar::Util fixed the problem, stopping the "Weak references" error, and rendering CPAN operable. You made my day!

    However, I remain perplexed. I don't understand why this problem occurred or how you diagnosed it.

    WRT 'why', unfortunately, I don't have a logging filesystem that could show all updates, and even if I did, I don't know how do identify the update(s) that caused this problem. My differential backup shows a change in /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/List/Util/Util.so on 120209, but the problem didn't surface until 12/6/9. I surmise that it didn't surface until the modified file was loaded, but I really don't know.

    WRT 'how', you say "your Perl did not compile the XS component of Scalar::Util, and your search seems to confirm that for me", but 'locate' found /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/List/Util/Util.so installed (although I should have used 'ls -l' to check its current status) so I didn't see any indication of Scalar::Util installation trouble other than the "Weak references" error.

    In any case, thanks again monks.