Apache2::ASP::Manual::ASP_Compilation - Documentation about ASP Compilation
When Apache2::ASP receives a request for an ASP script, it goes through the following steps:
ASP Scripts are "compiled" into Perl modules that look like the following:
#============================================================================== # THIS FILE WAS AUTOMATICALLY GENERATED BY Apache2::ASP::PageHandler. # TIMESTAMP: Thu Jun 28 23:18:17 2007 # CHANGES TO THIS FILE WILL BE OVERWRITTEN WHEN THE ASP SCRIPT IS CHANGED #============================================================================== package DefaultApp::index_asp; use strict; use warnings 'all'; no warnings 'redefine'; use base 'Apache2::ASP::PageHandler'; use vars qw( $Session $Server $Request $Response $Form $Application $Config ); our $TIMESTAMP = 1183094297; #line 1 sub process_request { $Response->Write(q~~); $Response->Write("Hello, World!"); return; ;$Response->Write(q~ ~); } 1;# return true: =pod =head2 process_request( ) =cut
Yes, you guessed it. This one prints "Hello, World!" to the browser.
If your ASP script is /index.asp then your *.pm file will be index_asp.pm.
/index.asp
index_asp.pm
If your ASP script is /members/bob/bio.asp then your *.pm file will be members_bob_bio_asp.pm.
/members/bob/bio.asp
members_bob_bio_asp.pm
And so on.
ASP scripts are compiled to Perl modules and stored on disk for 2 reasons:
Even though the ASP parser is quite fast (Apache2::ASP::Parser) it is still extra work that can be avoided.
By storing the resulting output on disk we can reduce some overhead and get a slight performance boost.
Yes - you can test your ASP scripts using Devel::Cover just like any other Perl module.
You can learn more about this by reading up on Apache2::ASP::Test::UserAgent.
Please read the Testing Intro at http://apache2-asp.no-ip.org/how-to/website-code-coverage-testing.asp to see how testing works.
It's possible that some bugs have found their way into this release.
Use RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=Apache2-ASP to submit bug reports.
Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.
John Drago mailto:jdrago_999@yahoo.com
Copyright 2007 John Drago, All rights reserved.
This software is free software. It may be used and distributed under the same terms as Perl itself.
To install Apache2::ASP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Apache2::ASP
CPAN shell
perl -MCPAN -e shell install Apache2::ASP
For more information on module installation, please visit the detailed CPAN module installation guide.