NAME

Apache2::ASP::Server - Utility object for Apache2::ASP programming

DESCRIPTION

The global $Server object is used in ASP programming for utility tasks such as string sanitation, finding files, sending email and registering subroutines to be performed asynchronously.

EXAMPLES

PUBLIC METHODS

URLEncode( $str )

Returns a URL-Encoded version of the string provided.

For example, "test@test.com" becomes "test%40test.com" with URLEncode().

HTMLEncode( $str )

Returns an HTML-Encoded version of the string provided.

For example, "<b>Hello</b>" becomes "&amp;lt;b&amp;gt;Hello&amp;lt;/b&amp;gt;" with HTMLEncode().

MapPath( $path )

Given a relative path MapPath() returns the absolute path to the file on disk.

For example, '/index.asp' might return '/usr/local/dstack/www/index.asp'.

Mail( %args )

A wrapper around the sendmail() function from Mail::Sendmail.

RegisterCleanup( $sub )

A wrapper around the function cleanup_register( $sub ) function provided by mod_perl2.

Pass in a subref that should be executed after the current request has completed.

For example:

<%
  $Server->RegisterCleanup(sub { do_something_later() });
  # Do more stuff here:
  $Response->Write("Hello!");
%>

AUTHOR

John Drago 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.