Tim Pushor wrote:
>
> Its probably just my thick headedness, but reading the SSI section on
> www.apache-asp.org now seems to make sense.
>
> I wasn't sure quite what you meant by compiling the include as a subroutine.
> If its a subroutine? what happens to the HTML?
>
The HTML gets printed as in $Response->Write('HTML');
> While we're on this subject, what *really* happens when an asp page
> containing both perl code and HTML gets compiled?
>
To see how a script is getting compiled, put an intended
perl syntax error in it, and set Debug to 1,2, or 3.
The perl script will be displayed in the browser.
Basically the ASP script gets turned inside out into a regular
perl script, with the HTML ending up in $Response->Write()
and the perl code just being perl. <%= %> is optimized
when surrounded by HTML to be like
$Reponse->Write('HTML'.$scalar_insert.'HTML');
So an ASP script like:
HTML <%= 'HEAD' %>
<% #code; %>
END
would become something like:
$Response->Write('HTML '. 'HEAD' .'
'); #code; $Response->Write('
END
');}
The white space is preserved so errors in the perl
script refer to real line #s. Also the final perl
script is wrapped up as a subroutine in the GlobalPackage
which defaults to a namespace derived off of where
Global & global.asa are located.
This is similar to how Apache::Registry compiles perl CGI
scripts, and the same caveats apply, for example try to avoid
defining subroutines in your ASP scripts, as you can
create a my closure problem that UseStrict won't catch.
For more info see the Parse, ParseHelper, & CompilePerl
subroutines in ASP.pm.
--Josh
_________________________________________________________________
Joshua Chamas Chamas Enterprises Inc.
NodeWorks Founder 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]