> I include a module X.pm in Apache's startup.pl, which has a public
> function f. I share this public function with Embperl by calling
>
> my $cp = HTML::Embperl::AddCompartment( 'SafeCompartment' );
> $cp->share_from( 'X', [ 'f' ] );
>
> after HTML::Embperl has been loaded. When I define optSafeNameSpace and
> optOpcodeMask in httpd.conf, however, f is not known to Perl code in
> documents.
>

The optOpcodeMask is only neccessary when you have defined an opcode mask in
the compartment (in which case it would also be nessecary to specify
EMBPERL_COMPARTMENT).

In your case, where you only want to share functions/variables, you have to
tell Embperl that it uses the package of the compartment, i.e. in addition
to set optSafeNameSpace and setting up the compartment as above, you need to
set

PerlSetEnv EMBPERL_PACKAGE SafeCompartment

this will run the pages in the package SafeCompartment, which is the one
Safe.pm shares the function/variables with (NOTE: from the point of the page
it runs still in package main). What you loose by this, is that every page
is compiled in it's own package, you either have to setup this of your own
or run them all in the same package.

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     [EMAIL PROTECTED]         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to