You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Eric Knauel <er...@ragnaroek.org> on 2000/06/25 10:13:18 UTC

[! !] and Execute

Hi,

I'm new to Embperl and wondering what happens in this case: I have an
applications that consists of several files/scripts which share a
common set of subs. I put this subs in a common.ep and (as described
on man Embperl) surrounded them with [! !]. 

So if I include this file with Execute from my scripts... Is it still
compiled once per script (from which it was inclued)? The scripts have 
all a diffrent scope?

Ciao,
     Eric

RE: [! !] and Execute

Posted by Gerald Richter <ri...@ecos.de>.
Hi,
>
> I'm new to Embperl and wondering what happens in this case: I have an
> applications that consists of several files/scripts which share a
> common set of subs.

Perl subroutines or Embperl subs [$ sub foo $] ?

> I put this subs in a common.ep and (as described
> on man Embperl) surrounded them with [! !].
>
> So if I include this file with Execute from my scripts... Is it still
> compiled once per script (from which it was inclued)? The scripts have
> all a diffrent scope?

The subs are comipled in the namespace of common.ep and this is done only
once. If you they are Embperl subs you can import them in the current
namespace with the import parameter of the execute function. Importing is
only done once per script.

If they are perl subs, you must use the full packagename to call them.

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