I've suggested using:

 use CGI qw(-compile :all);

in the Guide for a long time. Now I've read the following:

<QUOTE CGI.pm>
=item -compile

This causes the indicated autoloaded methods to be compiled up front,
rather than deferred to later.  This is useful for scripts that run
for an extended period of time under FastCGI or mod_perl, and for
those destined to be crunched by Malcom Beattie's Perl compiler.  Use
it in conjunction with the methods or method families you plan to use.

   use CGI qw(-compile :standard :html3);

or even

   use CGI qw(-compile :all);

Note that using the -compile pragma in this way will always have
the effect of importing the compiled functions into the current
namespace.  If you want to compile without importing use the
compile() method instead (see below).

=item -autoload

This overrides the autoloader so that any function in your program
that is not recognized is referred to CGI.pm for possible evaluation.
This allows you to use all the CGI.pm functions without adding them to
your symbol table, which is of concern for mod_perl users who are
worried about memory consumption.  I<Warning:> when
I<-autoload> is in effect, you cannot use "poetry mode"
(functions without the parenthesis).  Use I<hr()> rather
than I<hr>, or add something like I<use subs qw/hr p header/>
to the top of your script.
</QUOTE>

Two questions:

1. regarding -compile, if the tags are imported into the startup.pl's
package or main:: they aren't inhereted by child processes and therefore
not adding some memory size to the total child process size, am I right? 
(well it's shared anyway)

2. regarding -autoload. Do any of you use it? Is it really useful, isn't
it adding an overhead of AUTOLOAD?

Thanks!

P.S. Lincoln is on the Perl Cruise in Alaska so I don't expect to hear
from him in the next 2 weeks...

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://perl.org     http://stason.org/TULARC
http://singlesheaven.com http://perlmonth.com http://sourcegarden.org

Reply via email to