2008/4/30 Michele Beltrame <[EMAIL PROTECTED]>:
> Hello all!
>
>  I'm trying to use populate() to create a Callback constraint by passing
>  a code reference (HTML::FormFu::Constraint::Callback says passing a code
>  reference is possible). The error I get when passing a code ref is:
>
>  Can't store CODE items at 
> /usr/lib/perl5/vendor_perl/5.10.0/HTML/FormFu/ObjectUtil.pm line 860.

Thanks, that's now fixed in svn trunk (r998) by switching on
Storable's support for deserializing/eval-ing CODE-refs.

Note that any code-ref used cannot make use of anything outside the
scope of that code-ref.
For example, the code-ref in the test file
t/bugs/populate_element_coderef.t needs to call Test::More::ok()
rather than just ok() - this is because the code is eval'ed outside of
the original scope/package it originally occured in.

This effectively limits the code-ref to using @_ and explicit package
variables/subroutines.

Cheers,
Carl

_______________________________________________
HTML-FormFu mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to