perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Chamas <j...@chamas.com>
Subject Re: RFC: subroutines & script recompilation
Date Thu, 13 Feb 2003 19:32:31 GMT
ggincius  wrote:
>
>>If you have a site with exceedingly long scripts that have named
>>subroutines in them, then you might arguably need this config.
> 
> Yes, I have more than 1 site that have scripts with named
> subroutines in them... And never had problems with them (UseStrict 
> => 1). I like <% %> tags in subroutines. How can I put such subs 
> into .pm? Or move them into global.asa? Yes, I can move them 
> into .inc's and use with $Response->Include('...inc',...), but this 
> makes a lot of files... But these sites do not have a big load, so 
> maybe you are right, there is no big need for such option.
> 

The recommended way to have a sub with <% %> is to create
an include out of it, and call it via $Response->Include($file, @args).
You cannot have <% %> in normal perl modules, so this won't work
nor can you have <% %> in global.asa ( which is probably something
that should be allowed! )

To avoid the performance degradation of the recompile behavior
for named subs would be to use anonymous subs in that Apache::ASP
won't recompile when they are used.

Anonymous subs are created like:

my $sub = sub { ... };
&$sub(@args);

Regards,

Josh
________________________________________________________________
Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.                http://www.chamas.com
NodeWorks Link Checking                http://www.nodeworks.com


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Mime
View raw message