Mailing List Archive

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.

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?

_____

Thomas Corte
<thomas@knipp.de>
RE: Where should I put common Perl functions and Embperl [$subs$]? [ In reply to ]
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
-------------------------------------------------------------