>
> One thing that I am doing now is making use of Embperl [$ sub $] [$
> endsub $] for defining subroutines. If I read the documentation
> correctly these subroutines will be 'imported' into any page that I
> import them into. I see no mention of reuse of these subroutines, each
> page seems to get it's own compiled copy in it's namespace.
>

No, the subroutines are compiled in one package, and only the names are
imported in each page from which you call Execute with the import parameter.
So the subroutines get resued. It's just the same as Perl's "use".

> I am wondering if during the Execute I can set the PACKAGE that the
> subroutines are compiled into like:
>
>  Execute( { inputfile => '/include/subs.emb', package => 'Subs', import
> => 1 } );
>
> and then use
>
>  [- Subs::subroutine -]
>
> in my pages.
>
> I could run this once in my startup.pl, pre-compile the subroutines and
> reuse them.
>
You can do so. Use import => 0, to only compile your subroutines and not
import the names in the namespace of your startup.pl:

  Execute( { inputfile => '/include/subs.emb', package => 'Subs', import =>
0 } );

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

Reply via email to