Mailing List Archive

suggestion for Embperl Execute nested
Gerald, et al;

Please consider this:

I am calling a (child) epl from a (parent) epl via [- Execute($child,
$param) -]
The child epl does some processing based on the passed $param and creates
some variables. The problem is that I would like to use child's vars in the
parent epl and i don't want to have to pass these vars by reference.

My proposal is thus:
Let Execute have ability to return a value and/or have an option such that
child epls run in the same namespace as the parent epl.

What do you think?
Thank you.

ilia.
RE: suggestion for Embperl Execute nested [ In reply to ]
>
> I am calling a (child) epl from a (parent) epl via [- Execute($child,
> $param) -]
> The child epl does some processing based on the passed $param and creates
> some variables. The problem is that I would like to use child's
> vars in the
> parent epl and i don't want to have to pass these vars by reference.
>
> My proposal is thus:
> Let Execute have ability to return a value and/or have an option such that
> child epls run in the same namespace as the parent epl.
>

Returning a value is already on the todo list.

You can execute the child and the parent in the same namespace by using:

Execute ({inputfile => 'foo.htm', package => __PACKAGE__, param => ['foo',
'bar']}) ;

If you want to do this you should fetch the newest CVS Version of Embperl
(or wait for 1.3b3) to avoid problems with caching, if the child page is
included in more the one parent page). Note: If you call your child page in
this way it is recompiled be every new parent page (and therefore taking up
more memory, for every page from where you call it)

If you do

Execute ({inputfile => 'foo.htm', param => \@bar}) ;

you can return a value by assingin it for example to

$param[0] in the child and then it is visible a $bar[0] in the parent.


Gerald


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

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