You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by abhishek jain <ma...@ejain.com> on 2007/01/14 20:19:20 UTC

does begin block effect any performance in modperl

Hi friends,
i need to know that if i add the following block then will it affect
anything in the execution of modperl apart from first time run.

BEGIN{
require'abc.pl';
require'large_file.pl';

};

I mean anything relative to the performance.is the begin block called
everytime orjust the first time and is it safe to define a function in a
file and call it with this method rather than a package ,

Pl. help me.

Thanks,
Abhishek jain.

Re: does begin block effect any performance in modperl

Posted by Clinton Gormley <cl...@traveljury.com>.
On Mon, 2007-01-15 at 00:49 +0530, abhishek jain wrote:
> Hi friends,
> i need to know that if i add the following block then will it affect
> anything in the execution of modperl apart from first time run.
> BEGIN{
> require'abc.pl';
> require'large_file.pl';
> 
> };
> 
> I mean anything relative to the performance.is the begin block called
> everytime orjust the first time and is it safe to define a function in
> a file and call it with this method rather than a package , 

The begin blocks are only run at compile time, so won't affect the
performance of future requests.

http://perl.apache.org/docs/2.0/user/coding/coding.html#C_BEGIN__Blocks

clint