perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Chamas <>
Subject Re: Executing ASP in scalar...
Date Sun, 27 May 2001 20:10:58 GMT
HÃ¥kan Lindqvist wrote:
> Hello!
> Is there any way to get Apache::ASP to do something like "$Response->Include"
> on a scalar containing ASP code instead of a filename (something like "eval"
> but for ASP instead of plain perl)?

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: $@");

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.

-- Josh

Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks <- Web Link Checking          Huntington Beach, CA  USA                1-714-625-4051

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message