Håkan Lindqvist wrote:
> 
> 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.
> 

Yes, the code was a bit off, this actually seems to work for me
as an ASP script example:

<%
&my_execute("<\% print ('test print'); %\>");

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;
}
%>

Note the above code uses methods & members that are not
documented and may change, but hopefully the next release
I'll have this functionality for real and you can just replace
this code with the real API call.

--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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to