perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Håkan Lindqvist <lindqv...@netstar.se>
Subject Re: Executing ASP in scalar...
Date Sun, 27 May 2001 22:08:50 GMT
On Sunday 27 May 2001 22:10, Joshua Chamas wrote:
[snip]
> Until this functionality is released officially, I would try something
> like:
>
> ( untested )
> sub my_execute {
>   my $asp_script = shift;
>   my $ASP = $main::Server->{asp}
>   my $perl_script = $ASP->Parse(\$asp_script);
>   my $sub = eval "sub { package $ASP->{GlobalASA}{'package'}; $perl_script
> }"; $@ && die("error compiling sub: $@");
>   eval { &$sub };
>   $@ && die("error executing sub: $@");
>   1;
> }
>
> To really support this functionality, I will need to move
> all the ASP scripts being stored in a Tie::Cache kind of hash
> of sub closures for the scripts, for those that try to reap
> the benefits of an Apache::SizeLimit structure, where each
> process might keep only 100 scripts compiled with a setting
> on ScriptCacheSize ...
>
> Otherwise the above functionality would either not receive the
> benefits of caching, or would contribute to process bloat as
> each dynamic script got compiled & cached at runtime.

Thank you very much for your helpful response... it seems however that the 
code you supplied does not really work... (I know, you did say it was 
untested.... and I honestly did not fully understand the code, so the 
solution may be very obvious for you)...

Anyway, this is what I get:
error executing sub: Undefined subroutine 
&Apache::ASP::Compiles::_var_www_tmp_sitenew_global_asa::SCALAR called at 
(eval 295) line 1.


I really hope this functionality will eventually make it into Apache::ASP as 
it is _so_ useful... :)

/Håkan Lindqvist

>
> -- Josh
>
> _________________________________________________________________
> Joshua Chamas                           Chamas Enterprises Inc.
> NodeWorks <- Web Link Checking          Huntington Beach, CA  USA
> http://www.nodeworks.com                1-714-625-4051
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
> For additional commands, e-mail: asp-help@perl.apache.org

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


Mime
View raw message