process_request( )

NAME

Apache2::ASP::PageHandler - Handler class for *.asp scripts

SYNOPSIS

# Execute the page that the $asp object is pointing at, 
# and pass in some args to that page:
Apache2::ASP::PageHandler->run($asp, @args);

if( Apache2::ASP::PageHandler->asp_has_changed( $asp_filename ) ) { ... }

if( Apache2::ASP::PageHandler->asp_exists( $asp_filename ) ) { ... }

if( Apache2::ASP::PageHandler->pm_exists( $pm_filename ) ) { ... }

Apache2::ASP::PageHandler->compile_asp( $package_filename, $asp_filename, $pm_filename );

my $perl_module_code = Apache2::ASP::PageHandler->asp_to_package( $code, $package_name );

DESCRIPTION

This class is the subclass of Apache2::ASP::Handler that processes all requests for ASP scripts.

HOW DOES IT WORK?

It works by converting your ASP code into a Perl module, then loading that module up like any other Perl module.

Once loaded, your code is executed (like any other Perl module) and the result is printed to the client.

If your ASP script contains code like this:

<%
  $Response->Write("Hello, World!");
  $Response->End;
%>

You will end up with a file inside of $ENV{APACHE2_ASP_APPLICATION_ROOT}/PAGE_CACHE/[ApplicationName]/hello_world_asp.pm containing code like this:

#==============================================================================
# THIS FILE WAS AUTOMATICALLY GENERATED BY Apache2::ASP::PageHandler.
# TIMESTAMP: Wed Jun 20 23:42:53 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
);
#line 1
sub process_request { $Response->Write(q~~);
  $Response->Write("Hello, World!");
  return;
;$Response->Write(q~
~);
}
1;# return true:

=pod

=head2 process_request( )

=cut

Your code ends up inside of sub <process_request()> - so do not declare any subroutines in your ASP script. Doing so may end up causing a memory leak.

METHODS

run( $asp [, @args ] )

Executes whatever page the $asp->r->uri is pointed at.

Passes in @args to the ASP script upon execution as @_.

asp_has_changed( $pm_filename, $asp_filename )

Returns true if $asp_filename was last modified after $pm_filename was.

pm_exists( $pm_filename )

Returns true if $pm_filename exists.

asp_exists( $asp_filename )

Returns true if $asp_filename exists.

compile_asp( $pm_filename, $asp_filename, $full_package_name )

Compiles the $asp_filename into a package named $full_package_name and writes the resulting Perl code to $pm_filename.

init_page_class( $full_package_name )

Initializes the ASP objects in the namespace indicated by $full_package_name.

Classic ASP objects include $Session, $Server, $Application, $Request, $Response, $Form and $Config.

asp_to_package( $code, $package_name )

Places the $code into a real Perl module named $package_name, then returns the resulting Perl code.

BUGS

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.

HOMEPAGE

Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.

AUTHOR

John Drago mailto:jdrago_999@yahoo.com

COPYRIGHT AND LICENSE

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.