The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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

new( $asp )

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 "&lt;b&gt;Hello&lt;/b&gt;" with HTMLEncode().

HTMLDecode( $str )

Returns an HTML-Decoded version of the string provided.

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

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!");
  %>

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://apache2-asp.no-ip.org/ 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.