You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Thomas Corte <th...@hp9000.do.knipp.de> on 2000/06/16 10:43:20 UTC

Where should I put common Perl functions and Embperl [$subs$]?

Hi everybody,

trying to fine-tune my Embperl performance, I wonder where I should
place site-wide Perl functions and Embperl subs [$ ... $] to get
best performance.

RE: Where should I put common Perl functions and Embperl [$subs$]?

Posted by Gerald Richter <ri...@ecos.de>.
Hi,
>
> trying to fine-tune my Embperl performance, I wonder where I should
> place site-wide Perl functions and Embperl subs [$ ... $] to get
> best performance.
>
> >From the docs, I learned that *Embperl subs* are best placed in
> their own file and included via the Embperl Execute command,
> using import => 1.
>
> For "ordinary" Perl subs, I tried the same thing, putting them
> into an own file, surrounding them with [! !] to execute just once.
> However, Embperl does not seem to import the sub definitions at all.
>
> Should I put the subs into an ordinary .pm and use Exporter and
> use '...' instead?
>

Yes.

If you like, you could also put your [$ sub $] in a pm file, so it's side
wide available. It's not very well documented. See test/html/subimp.pm for
an example. If you like to have them exported, you need to add the code for
this to subimp.pm.

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