Apache :: ASP

INTRO
INSTALL
CONFIG
SYNTAX
EVENTS
OBJECTS
SSI
CGI
PERLSCRIPT
FAQ
TUNING
CREDITS
SUPPORT
SITES USING

EXAMPLES

Powered by ModPerl & Apache
PERLSCRIPT

Much work has been done to bring compatibility with ASP applications written in PerlScript under IIS. Most of that work revolved around bringing a Win32::OLE Collection interface to many of the objects in Apache::ASP, which are natively written as perl hashes.

The following objects in Apache::ASP respond as Collections:
        $Application
	$Session
	$Request->Form
	$Request->QueryString
	$Request->Cookies
	$Response->Cookies
	$Response->Cookies('Any Cookie')
And as such may be used with the following syntax, as compared with the Apache::ASP native calls. Please note the native Apache::ASP interface is compatible with the deprecated PerlScript interface.
	C = PerlScript Compatibility	N = Native Apache::ASP

        ## Collection->Contents($name)
	[C] $Application->Contents('XYZ')
	[N] $Application->{XYZ}

	## Collection->SetProperty($property, $name, $value)
	[C] $Application->Contents->SetProperty('Item', 'XYZ', "Fred");
	[N] $Application->{XYZ} = "Fred"

	## Collection->GetProperty($property, $name)
	[C] $Application->Contents->GetProperty('Item', 'XYZ')
	[N] $Application->{XYZ}

	## Collection->Item($name)
        [C] print $Request->QueryString->Item('message'), "<br>\n\n";
	[N] print $Request->{QueryString}{'message'}, "<br>\n\n";

	## Working with Cookies
	[C] $Response->SetProperty('Cookies', 'Testing', 'Extra');
	[C] $Response->SetProperty('Cookies', 'Testing', {'Path' => '/'});
	[C] print $Request->Cookies(Testing) . "<br>\n";
	[N] $Response->{Cookies}{Testing} = {Value => Extra, Path => '/'};
	[N] print $Request->{Cookies}{Testing} . "<br>\n";
Several incompatibilities exist between PerlScript and Apache::ASP:
 > Collection->{Count} property has not been implemented.
 > VBScript dates may not be used for Expires property of cookies.
 > Win32::OLE::in may not be used.  Use keys() to iterate over Collections.
 > The ->{Item} property does not work, use the ->Item() method.
Copyright (c) 1998-1999, Joshua Chamas, Chamas Enterprises Inc.