$Response->AppendToLog("Session_OnEnd! in ./eg/global.asa ". $Session->SessionID);
}
sub Application_OnStart {
$Response->AppendToLog("Application_OnStart! in ./eg/global.asa");
$Application->{Count} = 20;
}
sub Application_OnEnd {
$Response->AppendToLog("Application_OnEnd! in ./eg/global.asa");
}
# you can share globals between scripts as of v.10, as all scripts, including
# the global.asa are compiled into the same module
%EG = (
'.htaccess' => 'Configuration parameters that make Apache::ASP tick.',
'application.asp' => 'Uses $Application for incrementing a counter.',
'binary_write.htm' => '$Response->BinaryWrite() demo for an asp script serving a gif.',
'cgi.htm' => 'Shows compatibility with the CGI.pm library',
'counting.htm' => 'Simple asp syntax shown by wrapping a for loop around html and inserting a '.
'scalar value.',
'dynamic_includes.htm' => 'Shows an included file called as a subroutine.',
'error_document.htm' => 'Shows a custom error message using the $Response->ErrorDocument() API extension',
'filter.filter' => "Demonstrates Apache::ASP's ability to act both as a source and destination filter with Apache::Filter.",
'file_upload.asp' => 'File upload data can be read from the $Request->Form(), '.
'and is implemented via CGI.pm',
'footer.inc' => 'Footer include for most of the scripts listed.',
'form.asp' => 'Shows simple use of $Request->Form() and how to get raw input data '.
' from $Request->BinaryRead()',
'formfill.asp' =>
'Shows use of FormFill feature, which auto fills HTML forms from '.
'$Request->Form() data. One must install HTML::FillInForm to use this feature. ',
'global.asa' => 'The global.asa is the nervous system of an ASP application and '.
'is where you define your event handlers.',
'global_asa_demo.asp' => 'Shows how the global.asa can be used to track users in an '.
'application',
'header.inc' => 'Header include for most of the scripts listed here.',
'include.htm' => 'Shows how you can decompose a script into common included files',
# 'ordered_collections.ixhtm' =>
# 'Used with Tie::IxHash, shows the natural ordering of the $Request->Form() collection '.
# 'by how the browser submitted the data, useful for some.',
'register_cleanup.asp' => 'Demonstrates use of the API extension $Server->RegisterCleanup(). '.
'Execute code after a response completes in a fail safe way with this routine. ',
'response.asp' => 'Messy script showing much of the $Response object\'s functionality, '.
'including cookies and buffering.',
'row.inc' => 'File dynamically included in the dynamic_includes.htm example',
'server.htm' => 'Shows much of the $Server object\'s functionality',
'server_variables.htm' => '$Response->ServerVariables() are the equivalent of %ENV in ASP',
'session.asp' =>
'Shows use of the $Session object, and also demos one implementation '.
'of cookieless sessions.',
'session_query_parse.asp' =>
"Demonstrates automatic cookieless session support with the SessionQueryParse* ".
"settings.",
'source.asp' => 'Handy source code viewer used to let you easily view the source of '.
'the other asp scripts.',
'ssi_filter.ssi' => 'Shows full SSI in action via Apache::Filter & Apache::SSI. You must compile '.
'your apache with stacked handlers and install these modules to see '.
' this script',
'syntax_error.asp' => 'Demonstrates asp debugging with Debug 2 by creating a perl syntax error ',
'table.inc' => 'Another include used to demo dynamic_includes.htm',
'test.gif' => 'Source gif for the binary_write.htm example',
'transfer.htm' => '$Server->Transfer() use in action, for speedy redirect type behavior.',
'xml_subs.asp' =>
'XMLSubsMatch XML Extensions demonstrated, which all custom tags '.
'to be created by the developer.',
'xml_subs_strict.asp' =>
'XMLSubsStrict setting causes XMLSubs to accept only string literals '.
'for arguments, conforming to XML standard more strictly, and '.
'controlling XMLSubs execution to compile time arguments.',
'xslt.xml' => 'XSLT transformation of XML script, using XML::XSLT, and a DBM based cache with the XSLTCache setting. Also possible for the XSLTParser setting is XML::Sablotron for faster XSLT rendering.',
);
$SIG{__DIE__} = \&Carp::confess;
# note if you include XMLSubs in the global.asa, make sure to
# switch the package context to the XMLSubs namespace to avoid
# any odd variable scoping problems
package my;
sub my::include {
my($args, $text) = @_;
# reference the $Response object in the package namespace
# since we are in the my:: package and not the GlobalPackage/global.asa
$main::Response->Include($args->{src}, title => $args->{title});