hesco has asked for the wisdom of the Perl Monks concerning the following question:

This line:
use Scalar::Util qw(weaken);
Is throwing this error, in the browser:
Weak references are not implemented in the version of perl at /usr/loc +al/share/perl/5.8.8/CGI/FormBuilder.pm line 15 BEGIN failed--compilation aborted at /usr/local/share/perl/5.8.8/CGI/F +ormBuilder.pm line 15.
I'm installing an application on a brand new server, just used cpan to install a dozen or so dependencies. CGI::FormBuilder required force install to make it go. The install attempt gave me a very similar error message.

I'm using perl v5.8.8 and a Debian install on both the other machines this application was developed on, but without encountering this issue. Can anyone with some more experience with CGI::FormBuilder and Scalar::Util give me a clue how to work past this, please?

Thanks,
-- Hugh

UPDATE:

Well using apt-get install to grab the libcgi-formbuilder-perl package did not change the error at all.

But commenting out the 'weaken' inclusion did move me past that error. I wonder when that will come back to bite me.

if( $lal && $lol ) { $life++; }

Replies are listed 'Best First'.
Re: CGI::FormBuilder and unimplemented weak references; Ideas?
by ikegami (Patriarch) on Sep 06, 2008 at 03:43 UTC

    I hear all you have to do is recompile Scalar::Util to get weaken back.

    But commenting out the 'weaken' inclusion did move me past that error.

    You've introduced a memory leak.

Re: CGI::FormBuilder and unimplemented weak references; Ideas?
by moritz (Cardinal) on Sep 06, 2008 at 08:29 UTC
    Maybe get a copy of perl where weak references are implemented? They have their use, you know.

      They are unconditionally implemented at least as far back as 5.6.0 as far as I can tell. The error message is erroneous, resulting from a bad installation of Scalar::Util. You'd get that error if Scalar::Util couldn't find its compiled XS component, for example.

Re: CGI::FormBuilder and unimplemented weak references; Ideas?
by stonecolddevin (Parson) on Sep 08, 2008 at 21:38 UTC

    I hate to say this but I would use something like HTML::FormFu for your form validation. FormBuilder is a bit cludgy compared to newer stuff, and AFAICT FormFu doesn't have the same installation issues.

    Correct me if I'm wrong.

    meh.