# NAME
ASP4 - Fast, Simple and Scalable Web Development for Perl
# DESCRIPTION
ASP4 is a modern web development platform for Perl with a focus on speed, simplicity
and scalability.
# ASP OBJECTS
ASP4 brings our old friends `$Request`, `$Response`, `$Server` and `$Session`
back from the 1990's, but adds some new ever-present objects as well. Together
the ASP objects provide a consistent interface to the incoming request, outgoing response,
server environment and configuration in-use by the application itself.
## $Form
This is a simple hash reference which contains the names and values of the incoming
request parameters for both GET and POST requests.
For example, the following request...
/foo.asp?name=joe&color=red
...produces the following `$Form` object:
$VAR1 = {
name => 'joe',
color => 'red'
};
Access form data just like any other hashref:
Hello, {name} %>, I see your favorite color is {color} %>.
## $Server
The `$Server` object offers a few utility methods that don't really fit anywhere else.
### $Server->HTMLEncode( $string )
Given a string like `` returns a string like `<br/>`
### $Server->HTMLDecode( $string )
Given a string like `<br/>` returns a string like ``
### $Server->URLEncode( $string )
Given a string like `billg@microsoft.com` returns a string like `billg%40microsoft.com`
### $Server->URLDecode( $string )
Given a string like `billg%40microsoft.com` returns a string like `billg@microsoft.com`
### $Server->MapPath( $path )
Given a `$path` of `/foo.asp` would return something like `/var/www/example.com/htdocs/foo.asp`
### $Server->Mail( %args )
Sends an email via [Mail::Sendmail](http://search.cpan.org/perldoc?Mail::Sendmail). In fact it simply calls the `sendmail(...)` function
provided by [Mail::Sendmail](http://search.cpan.org/perldoc?Mail::Sendmail).
Simple Example:
$Server->Mail(
from => 'foo@bar.com',
to => 'bar@foo.com',
subject => 'Hello, world!',
message => 'this is a test message'
);
To send an HTML email do the following:
use MIME::Base64;
$Server->Mail(
from => 'foo@bar.com',
to => 'bar@foo.com',
subject => 'Hello, world!',
'content-type' => 'text/html',
'content-transfer-encoding' => 'base64',
message => encode_base64(<