Hi,
>
> The problem occurs when I call HTML::Embperl::Execute with an
> "inputfile" parameter and a "package" parameter.  The package consists of
> an instance of a Safe->root() that has data varglobbed in.
>
>[..]
> sub printTemplate
> {
>    my ($filename, $dataRef) = @_;
>
>    my $compartment = new Safe();
>
>    foreach (keys %{$dataRef}) {
>       $ {$compartment->varglob($_)} = $dataRef->{$_};
>    }
>
>    my $root = $compartment->root();
>
>    HTML::Embperl::Execute({ 'inputfile' => $filename, 'package'
> => $root});
> }
>

The problem is, that Embperl must know, that you want to run in a Safe
compartement. Just add

'options' => HTML::Embperl::optSafeNamespace

to the Excute parameters and it should work.

Gerald

BTW Without the optSafeNamespace your code will not run in a Safe namespace
at all. It only becomes safe, when it is call via $compartment -> reval.
optSafeNamespace does this for you.



-------------------------------------------------------------
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
-------------------------------------------------------------

Reply via email to