[Zope-Perl] New releases of Perl for Zope
Gisle Aas
gisle@ActiveState.com
23 Jan 2001 10:30:48 -0800
Joseph Wayne Norton <norton@alum.mit.edu> writes:
> After a long hiatus, I am re-looking at zoperl and how to incorporate
> zoperl into to our current zope tool-set. I would like to understand
> a) what perl packages can and cannot be "use"ed with the current
> PerlMethod Product?
Currently the 'require' opcode in PerlMethod is disallowed, so you
can't really use any library modules.
> and b) how to easily (and securely) modify the PerlMethod Product to
> allow a specific set of additional packages to be used in a PerlMethod script.
It should be possible to add code to the 'setup_compartment' function
in Zope.pm that enters additional functions into the compartment
namespace or simply a replacement module loader that return validated
CODE references that the PerlMethod can then use. The PerlMethod-code
will then look something like this:
my $enc = main::load_func("MIME::Base64", "encode_base64");
return &$enc($str);
instead of the normal:
use MIME::Base64 qw(encode_base64);
return encode_base64($str);
Getting OO libraries to work reliably inside these compartments seems
to be tricky. I also think it should be possible to simply write
PerlExternalMethods that do the external module stuff you want, and
then invoke these as Zope-methods from the PerlMethod.
> I'm also unable to use the zoperl Products out of the box right now.
> I'm using a configuration similar to the one described in this How-To:
>
> http://www.zope.org/Members/4am/instancehome
>
> I do not have any patches to provide at this time ... just for your
> information.
zoperl will always look for 'lib/perl/Zope.pm' and
'Extensions/ZopeExt' relative to INSTANCE_HOME. Where did your zoperl
stuff go?
Regards,
Gisle