Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Recent perl distributions without support for Scalar::Util::weaken() ?

by itub (Priest)
on May 25, 2005 at 18:03 UTC ( #460411=perlquestion: print w/ replies, xml ) Need Help??
itub has asked for the wisdom of the Perl Monks concerning the following question:

I've seen several cases of test failures and user complaints about my modules as a consequence of using Scalar::Util::weaken(). The error message is Error: Weak references are not implemented in the version of perl at (...). After looking at the Scalar::Util code, I found that this message occurs when the module is installed with the -pm option to Makefile.PL or when Makefile.PL couldn't find a C compiler. I can imagine this happening when a user installs Scalar::Util, but the strange thing is that it seems that in most cases they were using a perl-5.8.x "out of the box", which includes Scalar::Util as part of the core distribution.

Has anyone else noticed this? I've seen this message in Linux, Windows, and Cygwin.

Update: Thanks for all the answers. I'm happy to hear that I'm not alone. :-)

Comment on Recent perl distributions without support for Scalar::Util::weaken() ?
Re: Recent perl distributions without support for Scalar::Util::weaken() ?
by perrin (Chancellor) on May 25, 2005 at 18:18 UTC
    I've seen it on Fedora Core 2's perl. I just assumed it was more of the craziness of Red Hat's perl rpms.
Re: Recent perl distributions without support for Scalar::Util::weaken() ?
by merlyn (Sage) on May 25, 2005 at 18:23 UTC
Re: Recent perl distributions without support for Scalar::Util::weaken() ?
by brian_d_foy (Abbot) on May 25, 2005 at 19:12 UTC

    I've seen a few people complain about this problem, and they always solved it by compiling perl themselves. The vendors seem to do all sorts of odd things for the stock versions of perl. I wonder if you can surgically fix this by installing Scalar::Util yourself.

    I think the best you can hope for is a note in your docs that explains the error message and the fix (recompile perl or Scalar::Util).

    --
    brian d foy <brian@stonehenge.com>
Re: Recent perl distributions without support for Scalar::Util::weaken() ?
by magog (Beadle) on May 26, 2005 at 03:32 UTC

    I got this error when I was trying to use Scalar::Util from 5.6.x with perl 5.8.x.

    I've heard this can happen when a vendor_perl library tree is improperly managed. In my case it happened because I was maintaining a private library tree (which I then forgot about).

    I was convinced my perl was broken, until I discovered the long-forgotten library still there in my @INC.

    Michael

Re: Recent perl distributions without support for Scalar::Util::weaken() ?
by wolv (Monk) on May 30, 2005 at 12:19 UTC
    I had a similar issue with List::Util on Ubuntu Warty. Apparently, it doesn't come with the XS version of the module. The issue might be similar with Scalar::Util. Even worse, the pure-perl version of Scalar::Util (look in /usr/share/perl/5.8/Scalar/Util.pm, search for 'ESQ') doesn't implement all the features of the XS version.
Re: Recent perl distributions without support for Scalar::Util::weaken() ?
by eric256 (Parson) on Oct 26, 2007 at 18:06 UTC

    I had this problem with FedoraCore7! The fix is easy enough, do a force install with CPAN and all is good agian!


    ___________
    Eric Hodges
Re: Recent perl distributions without support for Scalar::Util::weaken() ?
by barvin (Beadle) on Dec 06, 2007 at 17:54 UTC
    This has happened to me a couple of times on Red Hat Enterprise. Always fixed with:
    perl -MCPAN -e shell force install Scalar::Util

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://460411]
Approved by dorko
Front-paged by bart
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (12)
As of 2014-10-21 12:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (103 votes), past polls