Apache-ASP
view release on metacpan or search on metacpan
site/eg/global.asa view on Meta::CPAN
$title = '';
}
sub Script_OnEnd {
$Response->Debug("Script_OnEnd $0 in global.asa");
$Session->{Ended}++;
}
# modify data on the way out
sub Script_OnFlush {
if($Response->{ContentType} eq 'text/html') {
my $data = $Response->{BinaryRef};
$$data =~ s/(\<(body|td).*?\>)/$1\<font $GlobalFont\>/isg;
}
my $data = $Response->{BinaryRef};
$Response->Debug("Script_OnFlush: about to flush ".length($$data)." bytes to client");
}
sub Session_OnStart {
$Session->{Count} = 10;
$Session->{onstart} = time();
$Application->{'Session'.$Session->SessionID} = '?';
$Response->AppendToLog("Session_OnStart! in ./eg/global.asa ". $Session->SessionID);
}
sub Session_OnEnd {
my $t_session_active = time() - $Session->{onstart};
$Application->{'Session'.$Session->SessionID} = $t_session_active;
$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.',
( run in 1.356 second using v1.01-cache-2.11-cpan-b16cb0d3907 )