.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "ASP 3pm" .TH ASP 3pm "2018-03-31" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" .Vb 1 \& Apache::ASP \- Active Server Pages for Apache with mod_perl .Ve .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& SetHandler perl\-script \& PerlModule Apache::ASP \& PerlHandler Apache::ASP \& PerlSetVar Global /tmp/asp .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Apache::ASP provides an Active Server Pages port to the Apache Web Server with Perl scripting only, and enables developing of dynamic web applications with session management and embedded Perl code. There are also many powerful extensions, including \s-1XML\s0 taglibs, \s-1XSLT\s0 rendering, and new events not originally part of the \s-1ASP API\s0! .PP This module works under the Apache Web Server with the mod_perl module enabled. See http://www.apache.org and http://perl.apache.org for further information. .PP This is a portable solution, similar to ActiveState's PerlScript for \s-1NT/IIS ASP.\s0 Work has been done and will continue to make ports to and from this implementation as smooth as possible. .PP For Apache::ASP downloading and installation, please read the \s-1INSTALL\s0 section. For installation troubleshooting check the \s-1FAQ\s0 and the \s-1SUPPORT\s0 sections. .PP For database access, ActiveX, scripting languages, and other miscellaneous issues please read the \s-1FAQ\s0 section. .SH "WEBSITE" .IX Header "WEBSITE" The Apache::ASP web site is at http://www.apache\-asp.org/ which you can also find in the ./site directory of the source distribution. .SH "INSTALL" .IX Header "INSTALL" The installation process for Apache::ASP is geared towards those with experience with Perl, Apache, and unix systems. For those without this experience, please understand that the learning curve can be significant. But what you have at the end will be a web site running on superior open source software. .PP If installing onto a Windows operating system, please see the section titled Win32 Install. .SS "Need Help" .IX Subsection "Need Help" Often, installing the mod_perl part of the Apache server can be the hardest part. If this is the case for you, check out the \s-1FAQ\s0 and \s-1SUPPORT\s0 sections for further help, as well as the \*(L"Modern Linux Distributions\*(R" notes in this section. .PP Please also see the mod_perl site at http://perl.apache.org/ which one ought to give a good read before undertaking a mod_perl project. .SS "Download and \s-1CPAN\s0 Install" .IX Subsection "Download and CPAN Install" You may download the latest Apache::ASP from your nearest \s-1CPAN,\s0 and also: .PP .Vb 2 \& http://search.cpan.org/dist/Apache\-ASP/ \& http://cpan.org/modules/by\-module/Apache/ .Ve .PP As a Perl developer, you should make yourself familiar with the \s-1CPAN\s0.pm module, and how it may be used to install Apache::ASP, and other related modules. The easiest way to install Apache::ASP for the first time from Perl is to fire up the \s-1CPAN\s0 shell like: .PP .Vb 6 \& shell prompt> perl \-MCPAN \-e shell \& ... configure CPAN ... \& ... then upgrade to latest CPAN ... \& cpan> install CPAN \& ... \& cpan> install Bundle::Apache::ASP .Ve .PP Installing the Apache::ASP bundle will automatically install all the modules Apache::ASP is dependent on as well as Apache::ASP itself. If you have trouble installing the bundle, then try installing the necessary modules one at a time: .PP .Vb 4 \& cpan> install MLDBM \& cpan> install MLDBM::Sync \& cpan> install Digest::MD5 *** may not be needed for perl 5.8+ *** \& cpan> install Apache::ASP .Ve .PP For extra/optional functionality in Apache::ASP 2.31 or greater, like support for FormFill, \s-1XSLT,\s0 or \s-1SSI,\s0 you can install this bundle via \s-1CPAN:\s0 .PP .Vb 1 \& cpan> install Bundle::Apache::ASP::Extra .Ve .SS "Regular Perl Module Install" .IX Subsection "Regular Perl Module Install" If not doing the \s-1CPAN\s0 install, download Apache::ASP and install it using the make or nmake commands as shown below. Otherwise, just copy \s-1ASP\s0.pm to \f(CW$PERLLIB\fR/site/Apache .PP .Vb 4 \& > perl Makefile.PL \& > make \& > make test \& > make install \& \& * use nmake for win32 .Ve .PP Please note that you must first have the Apache Web Server & mod_perl installed before using this module in a web server environment. The offline mode for building static html at \&./cgi/asp\-perl may be used with just perl. .SS "Modern Linux Distributions" .IX Subsection "Modern Linux Distributions" If you have a modern Linux distribution like CentOS or Ubuntu, you will likely have the easiest path by using the repository tools to automatically install mod_perl and Apache before installing Apache::ASP via \s-1CPAN.\s0 .PP For example for CentOS, this will install mod_perl into your apache httpd, the latter likely being installed already by default on your server: .PP .Vb 1 \& bash> sudo yum install mod_perl\-devel.x86_64 .Ve .PP For Ubuntu this would be done like this: .PP .Vb 1 \& bash> sudo apt\-get install libapache2\-mod\-perl2 .Ve .SS "Quick Start" .IX Subsection "Quick Start" Once you have successfully built the Apache Web Server with mod_perl, copy the ./site/eg/ directory from the Apache::ASP installation to your Apache document tree and try it out! You must put \*(L"AllowOverride All\*(R" in your httpd.conf config section to let the .htaccess file in the \&./site/eg installation directory do its work. If you want a starter config file for Apache::ASP, just look at the .htaccess file in the \&./site/eg/ directory. .PP So, you might add this to your Apache httpd.conf file just to get the scripts in ./site/eg working, where \f(CW$DOCUMENT_ROOT\fR represents the DocumentRoot config for your apache server: .PP .Vb 4 \& \& Options FollowSymLinks \& AllowOverride All \& .Ve .PP To copy the entire site, including the examples, you might do a raw directory copy as in: .PP .Vb 1 \& shell> cp \-rpd ./site $DOCUMENT_ROOT/asp .Ve .PP So you could then reference the Apache::ASP docs at /asp/ at your site, and the examples at /asp/eg/ . .PP This is not a good production configuration, because it is insecure with the FollowSymLinks, and tells Apache to look for .htaccess which is bad for performance but it should be handy for getting started with development. .PP You will know that Apache::ASP is working normally if you can run the scripts in ./site/eg/ without any errors. Common problems can be found in the \s-1FAQ\s0 section. .SS "Build static Apache and mod_perl for Apache 1.3.x" .IX Subsection "Build static Apache and mod_perl for Apache 1.3.x" For a quick build of apache, there is a script in the distribution at \&./make_httpd/build_httpds.sh that can compile a statically linked Apache with mod_ssl and mod_perl. Just drop the sources into the make_httpd directory, configure the environments as appropriate, and execute the script like this: .PP .Vb 1 \& make_httpd> ./build_httpds.sh .Ve .PP You might also find helpful a couple items: .PP .Vb 2 \& Stas\*(Aqs mod_perl guide install section \& http://perl.apache.org/guide/install.html \& \& Apache Toolbox \& http://www.apachetoolbox.com/ .Ve .PP People have been using Apache Toolbox to automate their complex builds of Apache 1.3.x with great success. .SS "Win32 / Windows Install" .IX Subsection "Win32 / Windows Install" If you are on a Win32 platform, like WinNT or Windows 2000, you can download the win32 binaries linked to from: .PP .Vb 1 \& http://perl.apache.org/download/binaries.html#Win32 .Ve .PP and install the latest perl\-win32\-bin\-*.exe file. .PP Randy Kobes has graciously provided these, which include compiled versions perl, mod_perl, apache, mod_ssl, as well as all the modules required by Apache::ASP and Apache::ASP itself. .PP After installing this distribution, in Apache2\econf\eperl.conf (pulled in via Apache2\econf\ehttpd.conf) there's directives that have Apache::ASP handle files placed under the Apache2\easp\e directory. There should be a sample Apache::ASP script there, printenv.html, accessed as http://127.0.0.1/asp/printenv.html which, if working, will print out your environment variables. .SS "WinME / 98 / 95 \fIflock()\fP workaround" .IX Subsection "WinME / 98 / 95 flock() workaround" For those on desktop Windows operation systems, Apache::ASP v2.25 and later needs a special work around for the lack of \fIflock()\fR support on these systems. Please add this to your Apache httpd.conf to fix this problem after mod_perl is installed: .PP .Vb 4 \& \& *CORE::GLOBAL::flock = sub { 1 }; \& \& PerlModule Apache::ASP .Ve .PP Please be sure to add this configuration before Apache::ASP is loaded via PerlModule, or a PerlRequire statement. .SH "CONFIG" .IX Header "CONFIG" You may use a directive in your httpd.conf Apache configuration file to make Apache::ASP start ticking. Configure the optional settings if you want, the defaults are fine to get started. The settings are documented below. Make sure Global is set to where your web applications global.asa is if you have one! .PP .Vb 7 \& PerlModule Apache::ASP \& \& SetHandler perl\-script \& PerlHandler Apache::ASP \& PerlSetVar Global . \& PerlSetVar StateDir /tmp/asp \& .Ve .PP \&\s-1NOTE:\s0 do not use this for the examples in ./site/eg. To get the examples working, check out the Quick Start section of \s-1INSTALL\s0 .PP You may use other Apache configuration tags like , , and , to separately define \s-1ASP\s0 configurations, but using the tag is natural for \&\s-1ASP\s0 application building because it lends itself naturally to mixed media per directory. For building many separate \&\s-1ASP\s0 sites, you might want to use separate .htaccess files, or tags in sections, the latter being better for performance. .SS "Core" .IX Subsection "Core" .IP "Global" 4 .IX Item "Global" Global is the nerve center of an Apache::ASP application, in which the global.asa may reside defining the web application's event handlers. .Sp This directory is pushed onto \f(CW@INC\fR, so you will be able to \*(L"use\*(R" and \*(L"require\*(R" files in this directory, and perl modules developed for this application may be dropped into this directory, for easy use. .Sp Unless StateDir is configured, this directory must be some writable directory by the web server. \f(CW$Session\fR and \f(CW$Application\fR object state files will be stored in this directory. If StateDir is configured, then ignore this paragraph, as it overrides the Global directory for this purpose. .Sp Includes, specified with or \f(CW$Response\fR\->\fIInclude()\fR syntax, may also be in this directory, please see section on includes for more information. .Sp .Vb 1 \& PerlSetVar Global /tmp .Ve .IP "GlobalPackage" 4 .IX Item "GlobalPackage" Perl package namespace that all scripts, includes, & global.asa events are compiled into. By default, GlobalPackage is some obscure name that is uniquely generated from the file path of the Global directory, and global.asa file. The use of explicitly naming the GlobalPackage is to allow scripts access to globals and subs defined in a perl module that is included with commands like: .Sp .Vb 2 \& in perl script: use Some::Package; \& in apache conf: PerlModule Some::Package \& \& PerlSetVar GlobalPackage Some::Package .Ve .IP "UniquePackages" 4 .IX Item "UniquePackages" default 0. Set to 1 to compile each script into its own perl package, so that subroutines defined in one script will not collide with another. .Sp By default, \s-1ASP\s0 scripts in a web application are compiled into the *same* perl package, so these scripts, their includes, and the global.asa events all share common globals & subroutines defined by each other. The problem for some developers was that they would at times define a subroutine of the same name in 2+ scripts, and one subroutine definition would redefine the other one because of the namespace collision. .Sp .Vb 1 \& PerlSetVar UniquePackages 0 .Ve .IP "DynamicIncludes" 4 .IX Item "DynamicIncludes" default 0. \s-1SSI\s0 file includes are normally inlined in the calling script, and the text gets compiled with the script as a whole. With this option set to \s-1TRUE,\s0 file includes are compiled as a separate subroutine and called when the script is run. The advantage of having this turned on is that the code compiled from the include can be shared between scripts, which keeps the script sizes smaller in memory, and keeps compile times down. .Sp .Vb 1 \& PerlSetVar DynamicIncludes 0 .Ve .IP "IncludesDir" 4 .IX Item "IncludesDir" no defaults. If set, this directory will also be used to look for includes when compiling scripts. By default the directory the script is in, and the Global directory are checked for includes. .Sp This extension was added so that includes could be easily shared between \s-1ASP\s0 applications, whereas placing includes in the Global directory only allows sharing between scripts in an application. .Sp .Vb 1 \& PerlSetVar IncludesDir . .Ve .Sp Also, multiple includes directories may be set by creating a directory list separated by a semicolon ';' as in .Sp .Vb 1 \& PerlSetVar IncludesDir ../shared;/usr/local/asp/shared .Ve .Sp Using IncludesDir in this way creates an includes search path that would look like ., Global, ../shared, /usr/local/asp/shared The current directory of the executing script is checked first whenever an include is specified, then the Global directory in which the global.asa resides, and finally the IncludesDir setting. .IP "NoCache" 4 .IX Item "NoCache" Default 0, if set to 1 will make it so that neither script nor include compilations are cached by the server. Using this configuration will save on memory but will slow down script execution. Please see the \s-1TUNING\s0 section for other strategies on improving site performance. .Sp .Vb 1 \& PerlSetVar NoCache 0 .Ve .SS "State Management" .IX Subsection "State Management" .IP "NoState" 4 .IX Item "NoState" default 0, if true, neither the \f(CW$Application\fR nor \f(CW$Session\fR objects will be created. Use this for a performance increase. Please note that this setting takes precedence over the AllowSessionState and AllowApplicationState settings. .Sp .Vb 1 \& PerlSetVar NoState 0 .Ve .IP "AllowSessionState" 4 .IX Item "AllowSessionState" Set to 0 for no session tracking, 1 by default If Session tracking is turned off, performance improves, but the \f(CW$Session\fR object is inaccessible. .Sp .Vb 1 \& PerlSetVar AllowSessionState 1 .Ve .Sp Note that if you want to dissallow session creation for certain non web browser user agents, like search engine spiders, you can use an init handler like: .Sp .Vb 1 \& PerlInitHandler "sub { $_[0]\->dir_config(\*(AqAllowSessionState\*(Aq, 0) }" .Ve .IP "AllowApplicationState" 4 .IX Item "AllowApplicationState" Default 1. If you want to leave \f(CW$Application\fR undefined, then set this to 0, for a performance increase of around 2\-3%. Allowing use of \&\f(CW$Application\fR is less expensive than \f(CW$Session\fR, as there is more work for the StateManager associated with \f(CW$Session\fR garbage collection so this parameter should be only used for extreme tuning. .Sp .Vb 1 \& PerlSetVar AllowApplicationState 1 .Ve .IP "StateDir" 4 .IX Item "StateDir" default \f(CW$Global\fR/.state. State files for \s-1ASP\s0 application go to this directory. Where the state files go is the most important determinant in what makes a unique \s-1ASP\s0 application. Different configs pointing to the same StateDir are part of the same \&\s-1ASP\s0 application. .Sp The default has not changed since implementing this config directive. The reason for this config option is to allow operating systems with caching file systems like Solaris to specify a state directory separately from the Global directory, which contains more permanent files. This way one may point StateDir to /tmp/myaspapp, and make one's \s-1ASP\s0 application scream with speed. .Sp .Vb 1 \& PerlSetVar StateDir ./.state .Ve .IP "StateManager" 4 .IX Item "StateManager" default 10, this number specifies the numbers of times per SessionTimeout that timed out sessions are garbage collected. The bigger the number, the slower your system, but the more precise Session_OnEnd's will be run from global.asa, which occur when a timed out session is cleaned up, and the better able to withstand Session guessing hacking attempts. The lower the number, the faster a normal system will run. .Sp The defaults of 20 minutes for SessionTimeout and 10 times for StateManager, has dead Sessions being cleaned up every 2 minutes. .Sp .Vb 1 \& PerlSetVar StateManager 10 .Ve .IP "StateDB" 4 .IX Item "StateDB" default SDBM_File, this is the internal database used for state objects like \f(CW$Application\fR and \f(CW$Session\fR. Because an SDBM_File \f(CW%hash\fR has a limit on the size of a record key+value pair, usually 1024 bytes, you may want to use another tied database like DB_File or MLDBM::Sync::SDBM_File. .Sp With lightweight \f(CW$Session\fR and \f(CW$Application\fR use, you can get away with SDBM_File, but if you load it up with complex data like \f(CW$Session\fR{key} = { # very large complex object } you might max out the 1024 limit. .Sp Currently StateDB can be: SDBM_File, MLDBM::Sync::SDBM_File, DB_File, and GDBM_File. Please let me know if you would like to add any more to this list. .Sp As of version .18, you may change this setting in a live production environment, and new state databases created will be of this format. With a prior version if you switch to a new StateDB, you would want to delete the old StateDir, as there will likely be incompatibilities between the different database formats, including the way garbage collection is handled. .Sp .Vb 1 \& PerlSetVar StateDB SDBM_File .Ve .IP "StateCache" 4 .IX Item "StateCache" Deprecated as of 2.23. There is no equivalent config for the functionality this represented from that version on. The 2.23 release represented a significant rewrite of the state management, moving to MLDBM::Sync for its subsystem. .IP "StateSerializer" 4 .IX Item "StateSerializer" default Data::Dumper, you may set this to Storable for faster serialization and storage of data into state objects. This is particularly useful when storing large objects in \&\f(CW$Session\fR and \f(CW$Application\fR, as the Storable.pm module has a faster implementation of freezing and thawing data from and to perl structures. Note that if you are storing this much data in your state databases, you may want to use DB_File since it does not have the default 1024 byte limit that SDBM_File has on key/value lengths. .Sp This configuration setting may be changed in production as the state database's serializer type is stored in the internal state manager which will always use Data::Dumper & SDBM_File to store data. .Sp .Vb 1 \& PerlSetVar StateSerializer Data::Dumper .Ve .SS "Sessions" .IX Subsection "Sessions" .IP "CookiePath" 4 .IX Item "CookiePath" \&\s-1URL\s0 root that client responds to by sending the session cookie. If your asp application falls under the server url \*(L"/asp\*(R", then you would set this variable to /asp. This then allows you to run different applications on the same server, with different user sessions for each application. .Sp .Vb 1 \& PerlSetVar CookiePath / .Ve .IP "CookieDomain" 4 .IX Item "CookieDomain" Default 0, this NON-PORTABLE configuration will allow sessions to span multiple web sites that match the same domain root. This is useful if your web sites are hosted on the same machine and can share the same StateDir configuration, and you want to shared the \f(CW$Session\fR data across web sites. Whatever this is set to, that will add a .Sp .Vb 1 \& ; domain=$CookieDomain .Ve .Sp part to the Set-Cookie: header set for the session-id cookie. .Sp .Vb 1 \& PerlSetVar CookieDomain .your.global.domain .Ve .IP "SessionTimeout" 4 .IX Item "SessionTimeout" Default 20 minutes, when a user's session has been inactive for this period of time, the Session_OnEnd event is run, if defined, for that session, and the contents of that session are destroyed. .Sp .Vb 1 \& PerlSetVar SessionTimeout 20 .Ve .IP "SecureSession" 4 .IX Item "SecureSession" default 0. Sets the secure tag for the session cookie, so that the cookie will only be transmitted by the browser under https transmissions. .Sp .Vb 1 \& PerlSetVar SecureSession 1 .Ve .IP "HTTPOnlySession" 4 .IX Item "HTTPOnlySession" default 0. Sets HttpOnly flag to session cookie to mitigate \s-1XSS\s0 attacks. Supported by most modern browsers, it only allows access to the session cookie by the server (ie \s-1NOT\s0 Javascript) .Sp .Vb 1 \& PerlSetVar HTTPOnlySession 1 .Ve .IP "ParanoidSession" 4 .IX Item "ParanoidSession" default 0. When true, stores the user-agent header of the browser that creates the session and validates this against the session cookie presented. If this check fails, the session is killed, with the rationale that there is a hacking attempt underway. .Sp This config option was implemented to be a smooth upgrade, as you can turn it off and on, without disrupting current sessions. Sessions must be created with this turned on for the security to take effect. .Sp This config option is to help prevent a brute force cookie search from being successful. The number of possible cookies is huge, 2^128, thus making such a hacking attempt \s-1VERY\s0 unlikely. However, on the off chance that such an attack is successful, the hacker must also present identical browser headers to authenticate the session, or the session will be destroyed. Thus the User-Agent acts as a backup to the real session id. The \s-1IP\s0 address of the browser cannot be used, since because of proxies, \&\s-1IP\s0 addresses may change between requests during a session. .Sp There are a few browsers that will not present a User-Agent header. These browsers are considered to be browsers of type \*(L"Unknown\*(R", and this method works the same way for them. .Sp Most people agree that this level of security is unnecessary, thus it is titled paranoid :) .Sp .Vb 1 \& PerlSetVar ParanoidSession 0 .Ve .IP "SessionSerialize" 4 .IX Item "SessionSerialize" default 0, if true, locks \f(CW$Session\fR for duration of script, which serializes requests to the \f(CW$Session\fR object. Only one script at a time may run, per user \f(CW$Session\fR, with sessions allowed. .Sp Serialized requests to the session object is the Microsoft \s-1ASP\s0 way, but is dangerous in a production environment, where there is risk of long-running or run-away processes. If these things happen, a session may be locked for an indefinite period of time. A user \&\s-1STOP\s0 button should safely quit the session however. .Sp .Vb 1 \& PerlSetVar SessionSerialize 0 .Ve .IP "SessionCount" 4 .IX Item "SessionCount" default 0, if true enables the \f(CW$Application\fR\->SessionCount \s-1API\s0 which returns how many sessions are currently active in the application. This config was created because there is a performance hit associated with this count tracking, so it is disabled by default. .Sp .Vb 1 \& PerlSetVar SessionCount 1 .Ve .SS "Cookieless Sessions" .IX Subsection "Cookieless Sessions" .IP "SessionQueryParse" 4 .IX Item "SessionQueryParse" default 0, if true, will automatically parse the \f(CW$Session\fR session id into the query string of each local \s-1URL\s0 found in the \&\f(CW$Response\fR buffer. For this setting to work therefore, buffering must be enabled. This parsing will only occur when a session cookie has not been sent by a browser, so the first script of a session enabled site, and scripts viewed by web browsers that have cookies disabled will trigger this behavior. .Sp Although this runtime parsing method is computationally expensive, this cost should be amortized across most users that will not need this \s-1URL\s0 parsing. This is a lazy programmer's dream. For something more efficient, look at the SessionQuery setting. For more information about this solution, please read the \s-1SESSIONS\s0 section. .Sp .Vb 1 \& PerlSetVar SessionQueryParse 0 .Ve .IP "SessionQueryParseMatch" 4 .IX Item "SessionQueryParseMatch" default 0, set to a regexp pattern that matches all URLs that you want to have SessionQueryParse parse in session ids. By default SessionQueryParse only modifies local URLs, but if you name your URLs of your site with absolute URLs like http://localhost then you will need to use this setting. So to match http://localhost URLs, you might set this pattern to ^http://localhost. Note that by setting this config, you are also setting SessionQueryParse. .Sp .Vb 1 \& PerlSetVar SessionQueryParseMatch ^https?://localhost .Ve .IP "SessionQuery" 4 .IX Item "SessionQuery" default 0, if set, the session id will be initialized from the \f(CW$Request\fR\->QueryString if not first found as a cookie. You can use this setting coupled with the .Sp .Vb 1 \& $Server\->URL($url, \e%params) .Ve .Sp \&\s-1API\s0 extension to generate local URLs with session ids in their query strings, for efficient cookieless session support. Note that if a browser has cookies disabled, every \s-1URL\s0 to any page that needs access to \f(CW$Session\fR will need to be created by this method, unless you are using SessionQueryParse which will do this for you automatically. .Sp .Vb 1 \& PerlSetVar SessionQuery 0 .Ve .IP "SessionQueryMatch" 4 .IX Item "SessionQueryMatch" default 0, set to a regexp pattern that will match URLs for \f(CW$Server\fR\->\s-1\fIURL\s0()\fR to add a session id to. SessionQuery normally allows \f(CW$Server\fR\->\s-1\fIURL\s0()\fR to add session ids just to local URLs, so if you use absolute \s-1URL\s0 references like http://localhost/ for your web site, then just like with SessionQueryParseMatch, you might set this pattern to ^http://localhost .Sp If this is set, then you don't need to set SessionQuery, as it will be set automatically. .Sp .Vb 1 \& PerlSetVar SessionQueryMatch ^http://localhost .Ve .IP "SessionQueryForce" 4 .IX Item "SessionQueryForce" default 0, set to 1 if you want to disallow the use of cookies for session id passing, and only allow session ids to be passed on the query string via SessionQuery and SessionQueryParse settings. .Sp .Vb 1 \& PerlSetVar SessionQueryForce 1 .Ve .SS "Developer Environment" .IX Subsection "Developer Environment" .IP "UseStrict" 4 .IX Item "UseStrict" default 0, if set to 1, will compile all scripts, global.asa and includes with \*(L"use strict;\*(R" inserted at the head of the file, saving you from the painful process of strictifying code that was not strict to begin with. .Sp Because of how essential \*(L"use strict\*(R" programming is in a mod_perl environment, this default might be set to 1 one day, but this will be up for discussion before that decision is made. .Sp Note too that errors triggered by \*(L"use strict\*(R" are now captured as part of the normal Apache::ASP error handling when this configuration is set, otherwise \&\*(L"use strict\*(R" errors will not be handled properly, so using UseStrict is better than your own \*(L"use strict\*(R" statements. .Sp PerlSetVar UseStrict 1 .IP "Debug" 4 .IX Item "Debug" 1 for server log debugging, 2 for extra client html output, 3 for microtimes logged. Use 1 for production debugging, use 2 or 3 for development. Turn off if you are not debugging. These settings activate \f(CW$Response\fR\->\fIDebug()\fR. .Sp .Vb 1 \& PerlSetVar Debug 2 .Ve .Sp If Debug 3 is set and Time::HiRes is installed, microtimes will show up in the log, and also calculate the time between one \f(CW$Response\fR\->\fIDebug()\fR and another, so good for a quick benchmark when you glance at the logs. .Sp .Vb 1 \& PerlSetVar Debug 3 .Ve .Sp If you would like to enable system level debugging, set Debug to a negative value. So for system level debugging, but no output to browser: .Sp .Vb 1 \& PerlSetVar Debug \-1 .Ve .IP "DebugBufferLength" 4 .IX Item "DebugBufferLength" Default 100, set this to the number of bytes of the buffered output's tail you want to see when an error occurs and Debug 2 or MailErrorsTo is set, and when BufferingOn is enabled. .Sp With buffering the script output will not naturally show up when the script errors, as it has been buffered by the \&\f(CW$Response\fR object. It helps to see where in the script output an error halted the script, so the last bytes of the buffered output are included with the rest of the debugging information. .Sp For a demo of this functionality, try the \&./site/eg/syntax_error.asp script, and turn buffering on. .IP "PodComments" 4 .IX Item "PodComments" default 1. With pod comments turned on, perl pod style comments and documentation are parsed out of scripts at compile time. This make for great documentation and a nice debugging tool, and it lets you comment out perl code and html in blocks. Specifically text like this: .Sp .Vb 3 \& =pod \& text or perl code here \& =cut .Ve .Sp will get ripped out of the script before compiling. The =pod and =cut perl directives must be at the beginning of the line, and must be followed by the end of the line. .Sp .Vb 1 \& PerlSetVar PodComments 1 .Ve .IP "CollectionItem" 4 .IX Item "CollectionItem" Enables PerlScript syntax like: .Sp .Vb 3 \& $Request\->Form(\*(Aqvar\*(Aq)\->Item; \& $Request\->Form(\*(Aqvar\*(Aq)\->Item(1); \& $Request\->Form(\*(Aqvar\*(Aq)\->Count; .Ve .Sp Old PerlScript syntax, enabled with .Sp .Vb 1 \& use Win32::OLE qw(in valof with OVERLOAD); .Ve .Sp is like native syntax .Sp .Vb 1 \& $Request\->Form(\*(Aqvar\*(Aq); .Ve .Sp Only in Apache::ASP, can the above be written as: .Sp .Vb 1 \& $Request\->{Form}{var}; .Ve .Sp which you would do if you _really_ needed the speed. .SS "\s-1XML / XSLT\s0" .IX Subsection "XML / XSLT" .IP "XMLSubsMatch" 4 .IX Item "XMLSubsMatch" default not defined, set to some regexp pattern that will match all \s-1XML\s0 and \s-1HTML\s0 tags that you want to have perl subroutines handle. The is Apache::ASP's custom tag technology, and can be used to create powerful extensions to your \s-1XML\s0 and \s-1HTML\s0 rendering. .Sp Please see \s-1XML/XSLT\s0 section for instructions on its use. .Sp .Vb 1 \& PerlSetVar XMLSubsMatch my:[\ew\e\-]+ .Ve .IP "XMLSubsStrict" 4 .IX Item "XMLSubsStrict" default 0, when set XMLSubs will only take arguments that are properly formed \s-1XML\s0 tag arguments like: .Sp .Vb 1 \& .Ve .Sp By default, XMLSubs accept arbitrary perl code as argument values: .Sp .Vb 1 \& .Ve .Sp which is not always wanted or expected. Set XMLSubsStrict to 1 if this is the case. .Sp .Vb 1 \& PerlSetVar XMLSubsStrict 1 .Ve .IP "XMLSubsPerlArgs" 4 .IX Item "XMLSubsPerlArgs" default 1, when set attribute values will be interpreted as raw perl code so that these all would execute as one would expect: .Sp .Vb 1 \& .Ve .Sp With the 2.45 release, 0 may be set for this configuration or a more \s-1ASP\s0 style variable interpolation: .Sp .Vb 1 \& .Ve .Sp This configuration is being introduced experimentally in version 2.45, as it will become the eventual default in the 3.0 release. .Sp .Vb 1 \& PerlSetVar XMLSubsPerlArgs Off .Ve .IP "\s-1XSLT\s0" 4 .IX Item "XSLT" default not defined, if set to a file, \s-1ASP\s0 scripts will be regarded as \s-1XML\s0 output and transformed with the given \&\s-1XSL\s0 file with \s-1XML::XSLT.\s0 This \s-1XSL\s0 file will also be executed as an \s-1ASP\s0 script first, and its output will be the \s-1XSL\s0 data used for the transformation. This \s-1XSL\s0 file will be executed as a dynamic include, so may be located in the current directory, Global, or IncludesDir. .Sp Please see the \s-1XML/XSLT\s0 section for an explanation of its use. .Sp .Vb 1 \& PerlSetVar XSLT template.xsl .Ve .IP "XSLTMatch" 4 .IX Item "XSLTMatch" default .*, if \s-1XSLT\s0 is set by default all \s-1ASP\s0 scripts will be \s-1XSL\s0 transformed by the specified \s-1XSL\s0 template. This regexp setting will tell \s-1XSLT\s0 which file names to match with doing \s-1XSL\s0 transformations, so that regular \&\s-1HTML ASP\s0 scripts and \s-1XML ASP\s0 scripts can be configured with the same configuration block. Please see \&./site/eg/.htaccess for an example of its use. .Sp .Vb 1 \& PerlSetVar XSLTMatch \e.xml$ .Ve .IP "XSLTParser" 4 .IX Item "XSLTParser" default \s-1XML::XSLT,\s0 determines which perl module to use for \&\s-1XSLT\s0 parsing. This is a new config as of 2.11. Also supported is XML::Sablotron which does not handle \s-1XSLT\s0 with the exact same output, but is about 10 times faster than \s-1XML::XSLT.\s0 XML::LibXSLT may also be used as of version 2.29, and seems to be about twice again as fast as XML::Sablotron, and a very complete \s-1XSLT\s0 implementation. .Sp .Vb 3 \& PerlSetVar XSLTParser XML::XSLT \& PerlSetVar XSLTParser XML::Sablotron \& PerlSetVar XSLTParser XML::LibXSLT .Ve .IP "XSLTCache" 4 .IX Item "XSLTCache" Activate \s-1XSLT\s0 file based caching through CacheDB, CacheDir, and CacheSize settings. This gives cached \s-1XSLT\s0 performance near AxKit and greater than Cocoon. \s-1XSLT\s0 caches transformations keyed uniquely by \s-1XML & XSLT\s0 inputs. .Sp .Vb 1 \& PerlSetVar XSLTCache 1 .Ve .IP "XSLTCacheSize" 4 .IX Item "XSLTCacheSize" as of version 2.11, this config is no longer supported. .SS "Caching" .IX Subsection "Caching" The output caching layer is a file dbm based output cache that runs on top of the MLDBM::Sync so inherits its performance characteristics. With CacheDB set to MLDBM::Sync::SDBM_File, the cache layer is very fast at caching entries up to 20K in size, but for greater cached items, you should set CacheDB to another dbm like DB_File or GDBM_File. .PP In order for the cache layer to function properly, whether for \f(CW$Response\fR\->\fIInclude()\fR output caching, see \s-1OBJECTS,\s0 or \s-1XSLT\s0 caching, see \s-1XML/XSLT,\s0 then Apache::ASP must be loaded in the parent httpd like so: .PP .Vb 6 \& # httpd.conf \& PerlModule Apache::ASP \& \-\- or \-\- \& \& use Apache::ASP; \& .Ve .PP The cache layer automatically expires entries upon server restart, but for this to work, a \f(CW$ServerID\fR must be computed when the Apache::ASP module gets loaded to store in each cached item. Without the above done, each child httpd process will get its own \f(CW$ServerID\fR, so caching will not work at all. .PP This said, output caching will not work in raw \s-1CGI\s0 mode, just running under mod_perl. .IP "CacheDB" 4 .IX Item "CacheDB" Like StateDB, sets dbm format for caching. Since SDBM_File only support key/values pairs of around 1K max in length, the default for this is MLDBM::Sync::SDBM_File, which is very fast for < 20K output sizes. For caching larger data than 20K, DB_File or GDBM_File are probably better to use. .Sp .Vb 1 \& PerlSetVar CacheDB MLDBM::Sync::SDBM_File .Ve .Sp For your own benchmarks to test the relative speeds of the various DBMs under MLDBM::Sync, which is used by CacheDB, you may run the ./bench/bench_sync.pl script from the MLDBM::Sync distribution on your system. .IP "CacheDir" 4 .IX Item "CacheDir" By default, the cache directory is at StateDir/cache, but CacheDir can be used to set the StateDir value for caching purposes. One may want the CacheDir separate from StateDir for example StateDir might be a centrally network mounted file system, while CacheDir might be a local file cache. .Sp .Vb 1 \& PerlSetVar CacheDir /tmp/asp_demo .Ve .Sp On a system like Solaris where there is a \s-1RAM\s0 disk mounted on the system like /tmp, I could put the CacheDir there. On a system like Linux where files are cached pretty well by default, this is less important. .IP "CacheSize" 4 .IX Item "CacheSize" By default, this is 10M of data per cache. When any cache, like the XSLTCache, reaches this limit, the cache will be purged by deleting the cached dbm files entirely. This is better for long term running of dbms than deleting individual records, because dbm formats will often degrade in performance with lots of insert & deletes. .Sp Units of M, K, and B are supported for megabytes, kilobytes, and bytes, with the default unit being B, so the following configs all mean the same thing; .Sp .Vb 4 \& PerlSetVar CacheSize 10M \& PerlSetVar CacheSize 10240K \& PerlSetVar CacheSize 10485760B \& PerlSetVar CacheSize 10485760 .Ve .Sp There are 2 caches currently, the XSLTCache, and the Response cache, the latter which is currently invoked for caching output from includes with special syntax. See \f(CW$Response\fR\->\fIInclude()\fR for more info on the Response cache. .SS "Miscellaneous" .IX Subsection "Miscellaneous" .IP "AuthServerVariables" 4 .IX Item "AuthServerVariables" default 0. If you are using basic auth and would like \&\f(CW$Request\fR\->ServerVariables set like \s-1AUTH_TYPE, AUTH_USER,\s0 \&\s-1AUTH_NAME, REMOTE_USER, & AUTH_PASSWD,\s0 then set this and Apache::ASP will initialize these values from Apache\->*auth* commands. Use of these environment variables keeps applications cross platform compatible as other servers set these too when performing basic 401 auth. .Sp .Vb 1 \& PerlSetVar AuthServerVariables 0 .Ve .IP "BufferingOn" 4 .IX Item "BufferingOn" default 1, if true, buffers output through the response object. \&\f(CW$Response\fR object will only send results to client browser if a \f(CW$Response\fR\->\fIFlush()\fR is called, or if the asp script ends. Lots of output will need to be flushed incrementally. .Sp If false, 0, the output is immediately written to the client, \&\s-1CGI\s0 style. There will be a performance hit server side if output is flushed automatically to the client, but is probably small. .Sp I would leave this on, since error handling is poor, if your asp script errors after sending only some of the output. .Sp .Vb 1 \& PerlSetVar BufferingOn 1 .Ve .IP "InodeNames" 4 .IX Item "InodeNames" Default 0. Set to 1 to uses a \fIstat()\fR call on scripts and includes to derive subroutine namespace based on device and inode numbers. In case of multiple symbolic links pointing to the same script this will result in the script being compiled only once. Use only on unix flavours which support the \fIstat()\fR call that know about device and inode numbers. .Sp .Vb 1 \& PerlSetVar InodeNames 1 .Ve .IP "RequestParams" 4 .IX Item "RequestParams" Default 0, if set creates \f(CW$Request\fR\->Params object with combined contents of \f(CW$Request\fR\->QueryString and \f(CW$Request\fR\->Form. This is for developer convenience similar to \s-1CGI\s0.pm's \fIparam()\fR method. .Sp .Vb 1 \& PerlSetVar RequestParams 1 .Ve .IP "RequestBinaryRead" 4 .IX Item "RequestBinaryRead" Default On, if set to Off will not read \s-1POST\s0 data into \f(CW$Request\fR\->\fIForm()\fR. .Sp One potential reason for configuring this to Off might be to initialize the Apache::ASP object in an Apache handler phase earlier than the normal PerlRequestHandler phase, so that it does not interfere with normal reading of \s-1POST\s0 data later in the request. .Sp .Vb 1 \& PerlSetVar RequestBinaryRead On .Ve .IP "StatINC" 4 .IX Item "StatINC" default 0, if true, reloads perl libraries that have changed on disk automatically for \s-1ASP\s0 scripts. If false, the www server must be restarted for library changes to take effect. .Sp A known bug is that any functions that are exported, e.g. confess Carp qw(confess), will not be refreshed by StatINC. To refresh these, you must restart the www server. .Sp This setting should be used in development only because it is so slow. For a production version of StatINC, see StatINCMatch. .Sp .Vb 1 \& PerlSetVar StatINC 1 .Ve .IP "StatINCMatch" 4 .IX Item "StatINCMatch" default undef, if defined, it will be used as a regular expression to reload modules that match as in StatINC. This is useful because StatINC has a very high performance penalty in production, so if you can narrow the modules that are checked for reloading each script execution to a handful, you will only suffer a mild performance penalty. .Sp The StatINCMatch setting should be a regular expression like: Struct|LWP which would match on reloading Class/Struct.pm, and all the \s-1LWP/\s0.* libraries. .Sp If you define StatINCMatch, you do not need to define StatINC. .Sp .Vb 1 \& PerlSetVar StatINCMatch .* .Ve .IP "StatScripts" 4 .IX Item "StatScripts" default 1, if set to 0, changed scripts, global.asa, and includes will not be reloaded. Coupled with Apache mod_perl startup and restart handlers executing Apache::ASP\->\fILoader()\fR for your application this allows your application to be frozen, and only reloaded on the next server restart or stop/start. .Sp There are a few advantages for not reloading scripts and modules in production. First there is a slight performance improvement by not having to \fIstat()\fR the script, its includes and the global.asa every request. .Sp From an application deployment standpoint, you also gain the ability to deploy your application as a snapshot taken when the server starts and restarts. This provides you with the reassurance that during a production server update from development sources, you do not have to worry with sources being used for the wrong libraries and such, while they are all being copied over. .Sp Finally, though you really should not do this, you can work on a live production application, with a test server reloading changes, but your production server does see the changes until you restart or stop/start it. This saves your public from syntax errors while you are just doing a quick bug fix. .Sp .Vb 1 \& PerlSetVar StatScripts 1 .Ve .IP "SoftRedirect" 4 .IX Item "SoftRedirect" default 0, if true, a \f(CW$Response\fR\->\fIRedirect()\fR does not end the script. Normally, when a \fIRedirect()\fR is called, the script is ended automatically. SoftRedirect 1, is a standard way of doing redirects, allowing for html output after the redirect is specified. .Sp .Vb 1 \& PerlSetVar SoftRedirect 0 .Ve .IP "Filter" 4 .IX Item "Filter" On/Off, default Off. With filtering enabled, you can take advantage of full server side includes (\s-1SSI\s0), implemented through Apache::SSI. \&\s-1SSI\s0 is implemented through this mechanism by using Apache::Filter. A sample configuration for full \s-1SSI\s0 with filtering is in the \&./site/eg/.htaccess file, with a relevant example script ./site/eg/ssi_filter.ssi. .Sp You may only use this option with modperl v1.16 or greater installed and \s-1PERL_STACKED_HANDLERS\s0 enabled. Filtering may be used in conjunction with other handlers that are also \*(L"filter aware\*(R". If in doubt, try building your mod_perl with .Sp .Vb 1 \& perl Makefile.PL EVERYTHING=1 .Ve .Sp With filtering through Apache::SSI, you should expect near a a 20% performance decrease. .Sp .Vb 1 \& PerlSetVar Filter Off .Ve .IP "CgiHeaders" 4 .IX Item "CgiHeaders" default 0. When true, script output that looks like \s-1HTTP / CGI\s0 headers, will be added to the \s-1HTTP\s0 headers of the request. So you could add: Set-Cookie: test=message .Sp .Vb 5 \& ... \&to the top of your script, and all the headers preceding a newline \&will be added as if with a call to $Response\->AddHeader(). This \&functionality is here for compatibility with raw cgi scripts, \&and those used to this kind of coding. .Ve .Sp When set to 0, CgiHeaders style headers will not be parsed from the script response. .Sp .Vb 1 \& PerlSetVar CgiHeaders 0 .Ve .IP "Clean" 4 .IX Item "Clean" default 0, may be set between 1 and 9. This setting determine how much text/html output should be compressed. A setting of 1 strips mostly white space saving usually 10% in output size, at a performance cost of less than 5%. A setting of 9 goes much further saving anywhere 25% to 50% typically, but with a performance hit of 50%. .Sp This config option is implemented via HTML::Clean. Per script configuration of this setting is available via the \f(CW$Response\fR\->{Clean} property, which may also be set between 0 and 9. .Sp .Vb 1 \& PerlSetVar Clean 0 .Ve .IP "CompressGzip" 4 .IX Item "CompressGzip" default 0, if true will gzip compress \s-1HTML\s0 output on the fly if Compress::Zlib is installed, and the client browser supports it. Depending on the \s-1HTML\s0 being compressed, the client may see a 50% to 90% reduction in \s-1HTML\s0 output. I have seen 40K of \s-1HTML\s0 squeezed down to just under 6K. This will come at a 5%\-20% hit to \s-1CPU\s0 usage per request compressed. .Sp Note there are some cases when a browser says it will accept gzip encoding, but then not render it correctly. This behavior has been seen with \s-1IE5\s0 when set to use a proxy but not using a proxy, and the \s-1URL\s0 does not end with a .html or .htm. No work around has yet been found for this case so use at your own risk. .Sp .Vb 1 \& PerlSetVar CompressGzip 1 .Ve .IP "FormFill" 4 .IX Item "FormFill" default 0, if true will auto fill \s-1HTML\s0 forms with values from \f(CW$Request\fR\->\fIForm()\fR. This functionality is provided by use of HTML::FillInForm. For more information please see \*(L"perldoc HTML::FillInForm\*(R", and the example ./site/eg/formfill.asp. .Sp This feature can be enabled on a per form basis at runtime with \f(CW$Response\fR\->{FormFill} = 1 .Sp .Vb 1 \& PerlSetVar FormFill 1 .Ve .IP "TimeHiRes" 4 .IX Item "TimeHiRes" default 0, if set and Time::HiRes is installed, will do sub second timing of the time it takes Apache::ASP to process a request. This will not include the time spent in the session manager, nor modperl or Apache, and is only a rough approximation at best. .Sp If Debug is set also, you will get a comment in your \&\s-1HTML\s0 output that indicates the time it took to process that script. .Sp If system debugging is set with Debug \-1 or \-2, you will also get this time in the Apache error log with the other system messages. .SS "Mail Administration" .IX Subsection "Mail Administration" Apache::ASP has some powerful administrative email extensions that let you sleep at night, knowing full well that if an error occurs at the web site, you will know about it immediately. With these features already enabled, it was also easy to provide the \f(CW$Server\fR\->Mail(\e%mail) \s-1API\s0 extension which you can read up about in the \s-1OBJECTS\s0 section. .IP "MailHost" 4 .IX Item "MailHost" The mail host is the smtp server that the below Mail* config directives will use when sending their emails. By default Net::SMTP uses smtp mail hosts configured in Net::Config, which is set up at install time, but this setting can be used to override this config. .Sp The mail hosts specified in the Net::Config file will be used as backup smtp servers to the MailHost specified here, should this primary server not be working. .Sp .Vb 1 \& PerlSetVar MailHost smtp.yourdomain.com.foobar .Ve .IP "MailFrom" 4 .IX Item "MailFrom" Default \s-1NONE,\s0 set this to specify the default mail address placed in the From: mail header for the \f(CW$Server\fR\->\fIMail()\fR \s-1API\s0 extension, as well as MailErrorsTo and MailAlertTo. .Sp .Vb 1 \& PerlSetVar MailFrom youremail@yourdomain.com.foobar .Ve .IP "MailErrorsTo" 4 .IX Item "MailErrorsTo" No default, if set, \s-1ASP\s0 server errors, error code 500, that result while compiling or running scripts under Apache::ASP will automatically be emailed to the email address set for this config. This allows an administrator to have a rapid response to user generated server errors resulting from bugs in production \s-1ASP\s0 scripts. Other errors, such as 404 not found will be handled by Apache directly. .Sp An easy way to see this config in action is to have an \s-1ASP\s0 script which calls a \fIdie()\fR, which generates an internal \s-1ASP 500\s0 server error. .Sp The Debug config of value 2 and this setting are mutually exclusive, as Debug 2 is a development setting where errors are displayed in the browser, and MailErrorsTo is a production setting so that errors are silently logged and sent via email to the web admin. .Sp .Vb 1 \& PerlSetVar MailErrorsTo youremail@yourdomain.com .Ve .IP "MailAlertTo" 4 .IX Item "MailAlertTo" The address configured will have an email sent on any \s-1ASP\s0 server error 500, and the message will be short enough to fit on a text based pager. This config setting would be used to give an administrator a heads up that a www server error occurred, as opposed to MailErrorsTo would be used for debugging that server error. .Sp This config does not work when Debug 2 is set, as it is a setting for use in production only, where Debug 2 is for development use. .Sp .Vb 1 \& PerlSetVar MailAlertTo youremail@yourdomain.com .Ve .IP "MailAlertPeriod" 4 .IX Item "MailAlertPeriod" Default 20 minutes, this config specifies the time in minutes over which there may be only one alert email generated by MailAlertTo. The purpose of MailAlertTo is to give the admin a heads up that there is an error at the www server. MailErrorsTo is for to aid in speedy debugging of the incident. .Sp .Vb 1 \& PerlSetVar MailAlertPeriod 20 .Ve .SS "File Uploads" .IX Subsection "File Uploads" .IP "FileUploadMax" 4 .IX Item "FileUploadMax" default 0, if set will limit file uploads to this size in bytes. This is currently implemented by setting \f(CW$CGI::POST_MAX\fR before handling the file upload. Prior to this, a developer would have to hardcode a value for \f(CW$CGI::POST_MAX\fR to get this to work. .Sp .Vb 1 \& PerlSetVar 100000 .Ve .IP "FileUploadTemp" 4 .IX Item "FileUploadTemp" default 0, if set will leave a temp file on disk during the request, which may be helpful for processing by other programs, but is also a security risk in that other users on the operating system could potentially read this file while the script is running. .Sp The path to the temp file will be available at \&\f(CW$Request\fR\->{FileUpload}{$form_field}{TempFile}. The regular use of file uploads remains the same with the <$filehandle> to the upload at \&\f(CW$Request\fR\->{Form}{$form_field}. Please see the \s-1CGI\s0 section for more information on file uploads, and the \f(CW$Request\fR section in \s-1OBJECTS.\s0 .Sp .Vb 1 \& PerlSetVar FileUploadTemp 0 .Ve .SH "SYNTAX" .IX Header "SYNTAX" .SS "General" .IX Subsection "General" \&\s-1ASP\s0 embedding syntax allows one to embed code in html in 2 simple ways. The first is the <% xxx %> tag in which xxx is any valid perl code. The second is <%= xxx %> where xxx is some scalar value that will be inserted into the html directly. An easy print. .PP .Vb 1 \& A simple asp page would look like: \& \& \& \& \& For loop incrementing font size:

\& <% for(1..5) { %> \& \& Size = <%=$_%>
\& <% } %> \& \& \& .Ve .PP Notice that your perl code blocks can span any html. The for loop above iterates over the html without any special syntax. .SS "XMLSubs" .IX Subsection "XMLSubs" XMLSubs allows a developer to define custom handlers for \&\s-1HTML & XML\s0 tags, which can extend the natural syntax of the \s-1ASP\s0 environment. Configured like: .PP .Vb 1 \& PerlSetVar XMLSubsMatch site:\ew+ .Ve .PP A simple tag like: .PP .Vb 1 \& .Ve .PP can be constructed that could translate into: .PP .Vb 5 \& sub site::header { \& my $args = shift; \& print "$args\->{title}\en"; \& print "\en"; \& } .Ve .PP Better yet, one can use this functionality to trap and post process embedded \s-1HTML & XML\s0 like: .PP .Vb 3 \& \& ... some HTML here ... \& .Ve .PP and then: .PP .Vb 6 \& sub site::page { \& my($args, $html) = @_; \& &site::header($args); \& $main::Response\->Write($html); \& $main::Response\->Write(""); \& } .Ve .PP Though this could be used to fully render \s-1XML\s0 documents, it was not built for this purpose, but to add powerful tag extensions to \s-1HTML\s0 development environments. For full \s-1XML\s0 rendering, you ought to try an \s-1XSLT\s0 approach, also supported by Apache::ASP. .SS "Editors" .IX Subsection "Editors" As Apache::ASP supports a mixing of perl and \s-1HTML,\s0 any editor which supports development of one or the other would work well. The following editors are known to work well for developing Apache::ASP web sites: .PP .Vb 3 \& * Emacs, in perl or HTML modes. For a mmm\-mode config \& that mixes HTML & perl modes in a single buffer, check \& out the editors/mmm\-asp\-perl.el file in distribution. \& \& * Vim, special syntax support with editors/aasp.vim file in distribution. \& \& * UltraEdit32 ( http://www.ultraedit.com/ ) has syntax highlighting, \& good macros and a configurable wordlist (so one can have syntax \& highlighting both for Perl and HTML). .Ve .PP Please feel free to suggest your favorite development environment for this list. .SH "EVENTS" .IX Header "EVENTS" .SS "Overview" .IX Subsection "Overview" The \s-1ASP\s0 platform allows developers to create Web Applications. In fulfillment of real software requirements, \s-1ASP\s0 allows event-triggered actions to be taken, which are defined in a global.asa file. The global.asa file resides in the Global directory, defined as a config option, and may define the following actions: .PP .Vb 10 \& Action Event \& \-\-\-\-\-\- \-\-\-\-\-\- \& Script_OnStart * Beginning of Script execution \& Script_OnEnd * End of Script execution \& Script_OnFlush * Before $Response being flushed to client. \& Script_OnParse * Before script compilation \& Application_OnStart Beginning of Application \& Application_OnEnd End of Application \& Session_OnStart Beginning of user Session. \& Session_OnEnd End of user Session. \& \& * These are API extensions that are not portable, but were \& added because they are incredibly useful .Ve .PP These actions must be defined in the \f(CW$Global\fR/global.asa file as subroutines, for example: .PP .Vb 3 \& sub Session_OnStart { \& $Application\->{$Session\->SessionID()} = started; \& } .Ve .PP Sessions are easy to understand. When visiting a page in a web application, each user has one unique \f(CW$Session\fR. This session expires, after which the user will have a new \&\f(CW$Session\fR upon revisiting. .PP A web application starts when the user visits a page in that application, and has a new \f(CW$Session\fR created. Right before the first \f(CW$Session\fR is created, the \f(CW$Application\fR is created. When the last user \f(CW$Session\fR expires, that \f(CW$Application\fR expires also. For some web applications that are always busy, the Application_OnEnd event may never occur. .SS "Script_OnStart & Script_OnEnd" .IX Subsection "Script_OnStart & Script_OnEnd" The script events are used to run any code for all scripts in an application defined by a global.asa. Often, you would like to run the same code for every script, which you would otherwise have to add by hand, or add with a file include, but with these events, just add your code to the global.asa, and it will be run. .PP There is one caveat. Code in Script_OnEnd is not guaranteed to be run when \f(CW$Response\fR\->\fIEnd()\fR is called, since the program execution ends immediately at this event. To always run critical code, use the \s-1API\s0 extension: .PP .Vb 1 \& $Server\->RegisterCleanup() .Ve .SS "Session_OnStart" .IX Subsection "Session_OnStart" Triggered by the beginning of a user's session, Session_OnStart gets run before the user's executing script, and if the same session recently timed out, after the session's triggered Session_OnEnd. .PP The Session_OnStart is particularly useful for caching database data, and avoids having the caching handled by clumsy code inserted into each script being executed. .SS "Session_OnEnd" .IX Subsection "Session_OnEnd" Triggered by a user session ending, Session_OnEnd can be useful for cleaning up and analyzing user data accumulated during a session. .PP Sessions end when the session timeout expires, and the StateManager performs session cleanup. The timing of the Session_OnEnd does not occur immediately after the session times out, but when the first script runs after the session expires, and the StateManager allows for that session to be cleaned up. .PP So on a busy site with default SessionTimeout (20 minutes) and StateManager (10 times) settings, the Session_OnEnd for a particular session should be run near 22 minutes past the last activity that Session saw. A site infrequently visited will only have the Session_OnEnd run when a subsequent visit occurs, and theoretically the last session of an application ever run will never have its Session_OnEnd run. .PP Thus I would not put anything mission-critical in the Session_OnEnd, just stuff that would be nice to run whenever it gets run. .SS "Script_OnFlush" .IX Subsection "Script_OnFlush" \&\s-1API\s0 extension. This event will be called prior to flushing the \f(CW$Response\fR buffer to the web client. At this time, the \f(CW$Response\fR\->{BinaryRef} buffer reference may be used to modify the buffered output at runtime to apply global changes to scripts output without having to modify all the scripts. .PP .Vb 4 \& sub Script_OnFlush { \& my $ref = $Response\->{BinaryRef}; \& $$ref =~ s/\es+/ /sg; # to strip extra white space \& } .Ve .PP Check out the ./site/eg/global.asa for an example of its use. .SS "Script_OnParse" .IX Subsection "Script_OnParse" This event allows one to set up a source filter on the script text, allowing one to change the script on the fly before the compilation stage occurs. The script text is available in the \f(CW$Server\fR\->{ScriptRef} scalar reference, and can be accessed like so: .PP .Vb 4 \& sub Script_OnParse { \& my $code = $Server\->{ScriptRef} \& $$code .= " ADDED SOMETHING "; \& } .Ve .SS "Application_OnStart" .IX Subsection "Application_OnStart" This event marks the beginning of an \s-1ASP\s0 application, and is run just before the Session_OnStart of the first Session of an application. This event is useful to load up \&\f(CW$Application\fR with data that will be used in all user sessions. .SS "Application_OnEnd" .IX Subsection "Application_OnEnd" The end of the application is marked by this event, which is run after the last user session has timed out for a given \s-1ASP\s0 application. .SS "Server_OnStart ( pseudo-event )" .IX Subsection "Server_OnStart ( pseudo-event )" Some might want something like a Server_OnStart event, where some code gets runs when the web server starts. In mod_perl, this is easy to achieve outside of the scope of an \s-1ASP\s0 application, by putting some initialization code into a section in the httpd.conf file. Initializations that you would like to be shared with the child httpds are particularly useful, one such being the Apache::ASP\->\fILoader()\fR routine which you can read more about in the \s-1TUNING\s0 section \- Precompile Scripts subsection. It is could be called like: .PP .Vb 4 \& # httpd.conf \& \& Apache::ASP\->Loader($path, $pattern, %config) \& .Ve .PP So a section is your Server_OnStart routine! .SS "mod_perl handlers" .IX Subsection "mod_perl handlers" If one wants to extend one's environment with mod_perl handlers, Apache::ASP does not stop this. Basic use of Apache::ASP in fact only involves the content handler phase of mod_perl's PerlHandler, like .PP .Vb 3 \& SetHandler perl\-script \& PerlModule Apache::ASP \& PerlHandler Apache::ASP .Ve .PP But mod_perl allows for direct access to many more Apache event stages, for full list try \*(L"perldoc mod_perl\*(R" or buy the mod_perl Eagle book. Some commonly used ones are: .PP .Vb 6 \& PerlInitHandler \& PerlTransHandler \& PerlFixupHandler \& PerlHandler \& PerlLogHandler \& PerlCleanupHandler .Ve .PP For straight Apache::ASP programming, there are some equivalents, say Script_OnStart event instead of Init/Fixup stages, or \f(CW$Server\fR\->\fIRegisterCleanup()\fR for Log/Cleanup stages, but you can do things in the mod_perl handlers that you cannot do in Apache::ASP, especially if you want to handle all files globally, and not just \s-1ASP\s0 scripts. .PP For many Apache::* modules for use with mod_perl, of which Apache::ASP is just one, check out http://perl.apache.org/src/apache\-modlist.html .PP To gain access to the \s-1ASP\s0 objects like \f(CW$Session\fR outside in a non-PerlHandler mod_perl handler, you may use this \s-1API:\s0 .PP .Vb 1 \& my $ASP = Apache::ASP\->new($r); # $r is Apache\->request object .Ve .PP as in this possible Authen handler: .PP .Vb 8 \& \& use Apache::ASP; \& sub My::Auth::handler { \& my $r = shift; \& my $ASP = Apache::ASP\->new($r) \& my $Session = $ASP\->Session; \& } \& .Ve .PP Here are some examples of do-it-yourself mod_perl handler programming... .PP .Vb 1 \& === Forbid Bad HSlide User Agent === \& \& # httpd.conf \& PerlAccessHandler My::Access \& \& sub My::Access::handler { \& my $r = shift; \& if($r\->headers_in\->{\*(AqUSER_AGENT\*(Aq} =~ /HSlide/) { \& 403; \& } else { \& 200; \& } \& } \& \& \& === Runtime Path Parsing === .Ve .PP This example shows how one might take an arbitrary \&\s-1URL\s0 path /$path/$file.asp, and turn that into a runtime config for your site, so your scripts get executed always in your sites DocumentRoot. .PP .Vb 4 \& INPUT URL /SomeCategory/ \& OUTPUT \& Script: index.asp \& $Server\->Config(\*(AqPATH\*(Aq) eq \*(Aq/SomeCategory\*(Aq \& \& INPUT URL /SomeCategory/index.asp \& OUTPUT \& Script: index.asp \& $Server\->Config(\*(AqPATH\*(Aq) eq \*(Aq/SomeCategory\*(Aq \& \& INPUT URI /index.asp \& OUTPUT \& Script: index.asp \& $Server\->Config(\*(AqPATH\*(Aq) eq \*(Aq\*(Aq \& \& # httpd.conf \& PerlTransHandler My::Init \& use lib qw( $custom_perllib ); \& \& # $custom_perllib/My/Init.pm \& package My::Init; \& use strict; \& use Apache::Constants qw(:common); \& sub handler { \& my $r = shift; \& \& my $uri = $r\->uri || \*(Aq/\*(Aq; \& unless($uri =~ m|^(.*)(/([^/.]+\e.[\ew]+)?)$|i) { \& warn("can\*(Aqt parse uri $uri"); \& return DECLINED; \& } \& $uri = $2; \& my $PATH = $1 || \*(Aq\*(Aq; \& $r\->dir_config(\*(AqPATH\*(Aq, $PATH); \& \& if($uri eq \*(Aq/\*(Aq) { \& $uri = \*(Aq/index.asp\*(Aq; \& } \& \& $r\->uri($uri); \& $r\->filename($r\->document_root.$uri); \& \& DECLINED; \& } \& \& 1; .Ve .SH "OBJECTS" .IX Header "OBJECTS" The beauty of the \s-1ASP\s0 Object Model is that it takes the burden of \s-1CGI\s0 and Session Management off the developer, and puts them in objects accessible from any \&\s-1ASP\s0 script & include. For the perl programmer, treat these objects as globals accessible from anywhere in your \s-1ASP\s0 application. .PP The Apache::ASP object model supports the following: .PP .Vb 7 \& Object Function \& \-\-\-\-\-\- \-\-\-\-\-\-\-\- \& $Session \- user session state \& $Response \- output to browser \& $Request \- input from browser \& $Application \- application state \& $Server \- general methods .Ve .PP These objects, and their methods are further defined in the following sections. .PP If you would like to define your own global objects for use in your scripts and includes, you can initialize them in the global.asa Script_OnStart like: .PP .Vb 9 \& use vars qw( $Form $Site ); # declare globals \& sub Script_OnStart { \& $Site = My::Site\->new; # init $Site object \& $Form = $Request\->Form; # alias form data \& $Server\->RegisterCleanup(sub { # garbage collection \& $Site\->DESTROY; \& $Site = $Form = undef; \& }); \& } .Ve .PP In this way you can create site wide application objects and simple aliases for common functions. .ie n .SS "$Session Object" .el .SS "\f(CW$Session\fP Object" .IX Subsection "$Session Object" The \f(CW$Session\fR object keeps track of user and web client state, in a persistent manner, making it relatively easy to develop web applications. The \f(CW$Session\fR state is stored across \s-1HTTP\s0 connections, in database files in the Global or StateDir directories, and will persist across web server restarts. .PP The user session is referenced by a 128 bit / 32 byte \s-1MD5\s0 hex hashed cookie, and can be considered secure from session id guessing, or session hijacking. When a hacker fails to guess a session, the system times out for a second, and with 2**128 (3.4e38) keys to guess, a hacker will not be guessing an id any time soon. .PP If an incoming cookie matches a timed out or non-existent session, a new session is created with the incoming id. If the id matches a currently active session, the session is tied to it and returned. This is also similar to the Microsoft \s-1ASP\s0 implementation. .PP The \f(CW$Session\fR reference is a hash ref, and can be used as such to store data as in: .PP .Vb 2 \& $Session\->{count}++; # increment count by one \& %{$Session} = (); # clear $Session data .Ve .PP The \f(CW$Session\fR object state is implemented through \s-1MLDBM,\s0 and a user should be aware of the limitations of \s-1MLDBM.\s0 Basically, you can read complex structures, but not write them, directly: .PP .Vb 3 \& $data = $Session\->{complex}{data}; # Read ok. \& $Session\->{complex}{data} = $data; # Write NOT ok. \& $Session\->{complex} = {data => $data}; # Write ok, all at once. .Ve .PP Please see \s-1MLDBM\s0 for more information on this topic. \&\f(CW$Session\fR can also be used for the following methods and properties: .ie n .IP "$Session\->{CodePage}" 4 .el .IP "\f(CW$Session\fR\->{CodePage}" 4 .IX Item "$Session->{CodePage}" Not implemented. May never be until someone needs it. .ie n .IP "$Session\->{\s-1LCID\s0}" 4 .el .IP "\f(CW$Session\fR\->{\s-1LCID\s0}" 4 .IX Item "$Session->{LCID}" Not implemented. May never be until someone needs it. .ie n .IP "$Session\->{SessionID}" 4 .el .IP "\f(CW$Session\fR\->{SessionID}" 4 .IX Item "$Session->{SessionID}" SessionID property, returns the id for the current session, which is exchanged between the client and the server as a cookie. .ie n .IP "$Session\->{Timeout} [= $minutes]" 4 .el .IP "\f(CW$Session\fR\->{Timeout} [= \f(CW$minutes\fR]" 4 .IX Item "$Session->{Timeout} [= $minutes]" Timeout property, if minutes is being assigned, sets this default timeout for the user session, else returns the current session timeout. .Sp If a user session is inactive for the full timeout, the session is destroyed by the system. No one can access the session after it times out, and the system garbage collects it eventually. .ie n .IP "$Session\->\fIAbandon()\fR" 4 .el .IP "\f(CW$Session\fR\->\fIAbandon()\fR" 4 .IX Item "$Session->Abandon()" The abandon method times out the session immediately. All Session data is cleared in the process, just as when any session times out. .ie n .IP "$Session\->\fILock()\fR" 4 .el .IP "\f(CW$Session\fR\->\fILock()\fR" 4 .IX Item "$Session->Lock()" \&\s-1API\s0 extension. If you are about to use \f(CW$Session\fR for many consecutive reads or writes, you can improve performance by explicitly locking \&\f(CW$Session\fR, and then unlocking, like: .Sp .Vb 5 \& $Session\->Lock(); \& $Session\->{count}++; \& $Session\->{count}++; \& $Session\->{count}++; \& $Session\->UnLock(); .Ve .Sp This sequence causes \f(CW$Session\fR to be locked and unlocked only 1 time, instead of the 6 times that it would be locked otherwise, 2 for each increment with one to read and one to write. .Sp Because of flushing issues with SDBM_File and DB_File databases, each lock actually ties fresh to the database, so the performance savings here can be considerable. .Sp Note that if you have SessionSerialize set, \f(CW$Session\fR is already locked for each script invocation automatically, as if you had called \f(CW$Session\fR\->\fILock()\fR in Script_OnStart. Thus you do not need to worry about \f(CW$Session\fR locking for performance. Please read the section on SessionSerialize for more info. .ie n .IP "$Session\->\fIUnLock()\fR" 4 .el .IP "\f(CW$Session\fR\->\fIUnLock()\fR" 4 .IX Item "$Session->UnLock()" \&\s-1API\s0 Extension. Unlocks the \f(CW$Session\fR explicitly. If you do not call this, \&\f(CW$Session\fR will be unlocked automatically at the end of the script. .ie n .SS "$Response Object" .el .SS "\f(CW$Response\fP Object" .IX Subsection "$Response Object" This object manages the output from the \s-1ASP\s0 Application and the client web browser. It does not store state information like the \&\f(CW$Session\fR object but does have a wide array of methods to call. .ie n .IP "$Response\->{BinaryRef}" 4 .el .IP "\f(CW$Response\fR\->{BinaryRef}" 4 .IX Item "$Response->{BinaryRef}" \&\s-1API\s0 extension. This is a perl reference to the buffered output of the \f(CW$Response\fR object, and can be used in the Script_OnFlush global.asa event to modify the buffered output at runtime to apply global changes to scripts output without having to modify all the scripts. These changes take place before content is flushed to the client web browser. .Sp .Vb 4 \& sub Script_OnFlush { \& my $ref = $Response\->{BinaryRef}; \& $$ref =~ s/\es+/ /sg; # to strip extra white space \& } .Ve .Sp Check out the ./site/eg/global.asa for an example of its use. .ie n .IP "$Response\->{Buffer}" 4 .el .IP "\f(CW$Response\fR\->{Buffer}" 4 .IX Item "$Response->{Buffer}" Default 1, when \s-1TRUE\s0 sends output from script to client only at the end of processing the script. When 0, response is not buffered, and client is sent output as output is generated by the script. .ie n .IP "$Response\->{CacheControl}" 4 .el .IP "\f(CW$Response\fR\->{CacheControl}" 4 .IX Item "$Response->{CacheControl}" Default \*(L"private\*(R", when set to public allows proxy servers to cache the content. This setting controls the value set in the \s-1HTTP\s0 header Cache-Control .ie n .IP "$Response\->{Charset}" 4 .el .IP "\f(CW$Response\fR\->{Charset}" 4 .IX Item "$Response->{Charset}" This member when set appends itself to the value of the Content-Type \&\s-1HTTP\s0 header. If \f(CW$Response\fR\->{Charset} = '\s-1ISO\-LATIN\-1\s0' is set, the corresponding header would look like: .Sp .Vb 1 \& Content\-Type: text/html; charset=ISO\-LATIN\-1 .Ve .ie n .IP "$Response\->{Clean} = 0\-9;" 4 .el .IP "\f(CW$Response\fR\->{Clean} = 0\-9;" 4 .IX Item "$Response->{Clean} = 0-9;" \&\s-1API\s0 extension. Set the Clean level, default 0, on a per script basis. Clean of 1\-9 compresses text/html output. Please see the Clean config option for more information. This setting may also be useful even if using compression to obfuscate \s-1HTML.\s0 .ie n .IP "$Response\->{ContentType} = ""text/html""" 4 .el .IP "\f(CW$Response\fR\->{ContentType} = ``text/html''" 4 .IX Item "$Response->{ContentType} = text/html" Sets the \s-1MIME\s0 type for the current response being sent to the client. Sent as an \s-1HTTP\s0 header. .ie n .IP "$Response\->{Debug} = 1|0" 4 .el .IP "\f(CW$Response\fR\->{Debug} = 1|0" 4 .IX Item "$Response->{Debug} = 1|0" \&\s-1API\s0 extension. Default set to value of Debug config. May be used to temporarily activate or inactivate \f(CW$Response\fR\->\fIDebug()\fR behavior. Something like: .Sp .Vb 4 \& { \& local $Response\->{Debug} = 1; \& $Response\->Debug($values); \& } .Ve .Sp maybe be used to always log something. The \fIDebug()\fR method can be better than \fIAppendToLog()\fR because it will log data in data structures one level deep, whereas AppendToLog prints just raw string/scalar values. .ie n .IP "$Response\->{Expires} = $time" 4 .el .IP "\f(CW$Response\fR\->{Expires} = \f(CW$time\fR" 4 .IX Item "$Response->{Expires} = $time" Sends a response header to the client indicating the \f(CW$time\fR in \s-1SECONDS\s0 in which the document should expire. A time of 0 means immediate expiration. The header generated is a standard \&\s-1HTTP\s0 date like: \*(L"Wed, 09 Feb 1994 22:23:32 \s-1GMT\*(R".\s0 .ie n .IP "$Response\->{ExpiresAbsolute} = $date" 4 .el .IP "\f(CW$Response\fR\->{ExpiresAbsolute} = \f(CW$date\fR" 4 .IX Item "$Response->{ExpiresAbsolute} = $date" Sends a response header to the client with \f(CW$date\fR being an absolute time to expire. Formats accepted are all those accepted by \&\fIHTTP::Date::str2time()\fR, e.g. .Sp .Vb 2 \& "Wed, 09 Feb 1994 22:23:32 GMT" \-\- HTTP format \& "Tuesday, 08\-Feb\-94 14:15:29 GMT" \-\- old rfc850 HTTP format \& \& "08\-Feb\-94" \-\- old rfc850 HTTP format \& "09 Feb 1994" \-\- proposed new HTTP format \& \& "Feb 3 1994" \-\- Unix \*(Aqls \-l\*(Aq format \& "Feb 3 17:03" \-\- Unix \*(Aqls \-l\*(Aq format .Ve .ie n .IP "$Response\->{FormFill} = 0|1" 4 .el .IP "\f(CW$Response\fR\->{FormFill} = 0|1" 4 .IX Item "$Response->{FormFill} = 0|1" If true, \s-1HTML\s0 forms generated by the script output will be auto filled with data from \f(CW$Request\fR\->Form. This feature requires HTML::FillInForm to be installed. Please see the FormFill \s-1CONFIG\s0 for more information. .Sp This setting overrides the FormFill config at runtime for the script execution only. .ie n .IP "$Response\->{IsClientConnected}" 4 .el .IP "\f(CW$Response\fR\->{IsClientConnected}" 4 .IX Item "$Response->{IsClientConnected}" 1 if web client is connected, 0 if not. This value starts set to 1, and will be updated whenever a \&\f(CW$Response\fR\->\fIFlush()\fR is called. If BufferingOn is set, by default \f(CW$Response\fR\->\fIFlush()\fR will only be called at the end of the \s-1HTML\s0 output. .Sp As of version 2.23 this value is updated correctly before global.asa Script_OnStart is called, so global script termination may be correctly handled during that event, which one might want to do with excessive user \s-1STOP/RELOADS\s0 when the web server is very busy. .Sp An \s-1API\s0 extension \f(CW$Response\fR\->IsClientConnected may be called for refreshed connection status without calling first a \f(CW$Response\fR\->Flush .ie n .IP "$Response\->{\s-1PICS\s0}" 4 .el .IP "\f(CW$Response\fR\->{\s-1PICS\s0}" 4 .IX Item "$Response->{PICS}" If this property has been set, a PICS-Label \s-1HTTP\s0 header will be sent with its value. For those that do not know, \s-1PICS\s0 is a header that is useful in rating the internet. It stands for Platform for Internet Content Selection, and you can find more info about it at: http://www.w3.org .ie n .IP "$Response\->{Status} = $status" 4 .el .IP "\f(CW$Response\fR\->{Status} = \f(CW$status\fR" 4 .IX Item "$Response->{Status} = $status" Sets the status code returned by the server. Can be used to set messages like 500, internal server error .ie n .IP "$Response\->AddHeader($name, $value)" 4 .el .IP "\f(CW$Response\fR\->AddHeader($name, \f(CW$value\fR)" 4 .IX Item "$Response->AddHeader($name, $value)" Adds a custom header to a web page. Headers are sent only before any text from the main page is sent, so if you want to set a header after some text on a page, you must turn BufferingOn. .ie n .IP "$Response\->AppendToLog($message)" 4 .el .IP "\f(CW$Response\fR\->AppendToLog($message)" 4 .IX Item "$Response->AppendToLog($message)" Adds \f(CW$message\fR to the server log. Useful for debugging. .ie n .IP "$Response\->BinaryWrite($data)" 4 .el .IP "\f(CW$Response\fR\->BinaryWrite($data)" 4 .IX Item "$Response->BinaryWrite($data)" Writes binary data to the client. The only difference from \f(CW$Response\fR\->\fIWrite()\fR is that \f(CW$Response\fR\->\fIFlush()\fR is called internally first, so the data cannot be parsed as an html header. Flushing flushes the header if has not already been written. .Sp If you have set the \f(CW$Response\fR\->{ContentType} to something other than text/html, cgi header parsing (see \s-1CGI\s0 notes), will be automatically be turned off, so you will not necessarily need to use BinaryWrite for writing binary data. .Sp For an example of BinaryWrite, see the binary_write.htm example in ./site/eg/binary_write.htm .Sp Please note that if you are on Win32, you will need to call binmode on a file handle before reading, if its data is binary. .ie n .IP "$Response\->\fIClear()\fR" 4 .el .IP "\f(CW$Response\fR\->\fIClear()\fR" 4 .IX Item "$Response->Clear()" Erases buffered \s-1ASP\s0 output. .ie n .IP "$Response\->Cookies($name, [$key,] $value)" 4 .el .IP "\f(CW$Response\fR\->Cookies($name, [$key,] \f(CW$value\fR)" 4 .IX Item "$Response->Cookies($name, [$key,] $value)" Sets the key or attribute of cookie with name \f(CW$name\fR to the value \f(CW$value\fR. If \f(CW$key\fR is not defined, the Value of the cookie is set. \&\s-1ASP\s0 CookiePath is assumed to be / in these examples. .Sp .Vb 2 \& $Response\->Cookies(\*(Aqname\*(Aq, \*(Aqvalue\*(Aq); \& \-\-> Set\-Cookie: name=value; path=/ \& \& $Response\->Cookies("Test", "data1", "test value"); \& $Response\->Cookies("Test", "data2", "more test"); \& $Response\->Cookies( \& "Test", "Expires", \& &HTTP::Date::time2str(time+86400) \& ); \& $Response\->Cookies("Test", "Secure", 1); \& $Response\->Cookies("Test", "Path", "/"); \& $Response\->Cookies("Test", "Domain", "host.com"); \& \-\-> Set\-Cookie:Test=data1=test%20value&data2=more%20test; \e \& expires=Fri, 23 Apr 1999 07:19:52 GMT; \e \& path=/; domain=host.com; secure .Ve .Sp The latter use of \f(CW$key\fR in the cookies not only sets cookie attributes such as Expires, but also treats the cookie as a hash of key value pairs which can later be accesses by .Sp .Vb 2 \& $Request\->Cookies(\*(AqTest\*(Aq, \*(Aqdata1\*(Aq); \& $Request\->Cookies(\*(AqTest\*(Aq, \*(Aqdata2\*(Aq); .Ve .Sp Because this is perl, you can (\s-1NOT PORTABLE\s0) reference the cookies directly through hash notation. The same 5 commands above could be compressed to: .Sp .Vb 12 \& $Response\->{Cookies}{Test} = \& { \& Secure => 1, \& Value => \& { \& data1 => \*(Aqtest value\*(Aq, \& data2 => \*(Aqmore test\*(Aq \& }, \& Expires => 86400, # not portable, see above \& Domain => \*(Aqhost.com\*(Aq, \& Path => \*(Aq/\*(Aq \& }; .Ve .Sp and the first command would be: .Sp .Vb 3 \& # you don\*(Aqt need to use hash notation when you are only setting \& # a simple value \& $Response\->{Cookies}{\*(AqTest Name\*(Aq} = \*(AqTest Value\*(Aq; .Ve .Sp I prefer the hash notation for cookies, as this looks nice, and is quite perlish. It is here to stay. The \fICookie()\fR routine is very complex and does its best to allow access to the underlying hash structure of the data. This is the best emulation I could write trying to match the Collections functionality of cookies in \s-1IIS ASP.\s0 .Sp For more information on Cookies, please go to the source at http://home.netscape.com/newsref/std/cookie_spec.html .ie n .IP "$Response\->Debug(@args)" 4 .el .IP "\f(CW$Response\fR\->Debug(@args)" 4 .IX Item "$Response->Debug(@args)" \&\s-1API\s0 Extension. If the Debug config option is set greater than 0, this routine will write \f(CW@args\fR out to server error log. refs in \f(CW@args\fR will be expanded one level deep, so data in simple data structures like one-level hash refs and array refs will be displayed. \s-1CODE\s0 refs like .Sp .Vb 1 \& $Response\->Debug(sub { "some value" }); .Ve .Sp will be executed and their output added to the debug output. This extension allows the user to tie directly into the debugging capabilities of this module. .Sp While developing an app on a production server, it is often useful to have a separate error log for the application to catch debugging output separately. One way of implementing this is to use the Apache ErrorLog configuration directive to create a separate error log for a virtual host. .Sp If you want further debugging support, like stack traces in your code, consider doing things like: .Sp .Vb 2 \& $Response\->Debug( sub { Carp::longmess(\*(Aqdebug trace\*(Aq) }; \& $SIG{_\|_WARN_\|_} = \e&Carp::cluck; # then warn() will stack trace .Ve .Sp The only way at present to see exactly where in your script an error occurred is to set the Debug config directive to 2, and match the error line number to perl script generated from your \s-1ASP\s0 script. .Sp However, as of version 0.10, the perl script generated from the asp script should match almost exactly line by line, except in cases of inlined includes, which add to the text of the original script, pod comments which are entirely yanked out, and <% # comment %> style comments which have a \en added to them so they still work. .Sp If you would like to see the \s-1HTML\s0 preceding an error while developing, consider setting the BufferingOn config directive to 0. .ie n .IP "$Response\->\fIEnd()\fR" 4 .el .IP "\f(CW$Response\fR\->\fIEnd()\fR" 4 .IX Item "$Response->End()" Sends result to client, and immediately exits script. Automatically called at end of script, if not already called. .ie n .IP "$Response\->ErrorDocument($code, $uri)" 4 .el .IP "\f(CW$Response\fR\->ErrorDocument($code, \f(CW$uri\fR)" 4 .IX Item "$Response->ErrorDocument($code, $uri)" \&\s-1API\s0 extension that allows for the modification the Apache ErrorDocument at runtime. \f(CW$uri\fR may be a on site document, off site \s-1URL,\s0 or string containing the error message. .Sp This extension is useful if you want to have scripts set error codes with \f(CW$Response\fR\->{Status} like 401 for authentication failure, and to then control from the script what the error message looks like. .Sp For more information on the Apache ErrorDocument mechanism, please see ErrorDocument in the \s-1CORE\s0 Apache settings, and the Apache\->\fIcustom_response()\fR \s-1API,\s0 for which this method is a wrapper. .ie n .IP "$Response\->\fIFlush()\fR" 4 .el .IP "\f(CW$Response\fR\->\fIFlush()\fR" 4 .IX Item "$Response->Flush()" Sends buffered output to client and clears buffer. .ie n .IP "$Response\->Include($filename, @args)" 4 .el .IP "\f(CW$Response\fR\->Include($filename, \f(CW@args\fR)" 4 .IX Item "$Response->Include($filename, @args)" This \s-1API\s0 extension calls the routine compiled from asp script in \f(CW$filename\fR with the args \f(CW@args\fR. This is a direct translation of the \s-1SSI\s0 tag .Sp .Vb 1 \& .Ve .Sp Please see the \s-1SSI\s0 section for more on \s-1SSI\s0 in general. .Sp This \s-1API\s0 extension was created to allow greater modularization of code by allowing includes to be called with runtime arguments. Files included are compiled once, and the anonymous code ref from that compilation is cached, thus including a file in this manner is just like calling a perl subroutine. The \f(CW@args\fR can be found in \f(CW@_\fR in the includes like: .Sp .Vb 2 \& # include.inc \& <% my @args = @_; %> .Ve .Sp As of 2.23, multiple return values can be returned from an include like: .Sp .Vb 1 \& my @rv = $Response\->Include($filename, @args); .Ve .ie n .IP "$Response\->Include(\e%cache_args, @sub_args) *CACHE API*" 4 .el .IP "\f(CW$Response\fR\->Include(\e%cache_args, \f(CW@sub_args\fR) *CACHE API*" 4 .IX Item "$Response->Include(%cache_args, @sub_args) *CACHE API*" As of version 2.23, output from an include may be cached with this \s-1API\s0 and the \s-1CONFIG\s0 settings CacheDir & CacheDB. This can be used to execute expensive includes only rarely where applicable, drastically increasing performance in some cases. .Sp This \s-1API\s0 extension applies to the entire include family: .Sp .Vb 3 \& my @rv = $Response\->Include(\e%cache_args, @include_args) \& my $html_ref = $Response\->TrapInclude(\e%cache_args, @include_args) \& $Server\->Execute(\e%cache_args, @include_args) .Ve .Sp For this output cache to work, you must load Apache::ASP in the Apache parent httpd like so: .Sp .Vb 2 \& # httpd.conf \& PerlModule Apache::ASP .Ve .Sp The cache arguments are shown here .Sp .Vb 8 \& $Response\->Include({ \& File => \*(Aqfile.inc\*(Aq, \& Cache => 1, # to activate cache layer \& Expires => 3600, # to expire in one hour \& LastModified => time() \- 600, # to expire if cached before 10 minutes ago \& Key => $Request\->Form, # to cache based on checksum of serialized form data, \& Clear => 1, # always executes include & cache output \& }, @include_args); \& \& File \- include file to execute, can be file name or \e$script \& script data passed in as a string reference. \& \& Cache \- activate caching, will run like normal include without this \& \& Expires \- only cache for this long in seconds \& \& LastModified \- if cached before this time(), expire \& \& Key \- The cache item identity. Can be $data, \e$data, \e%data, \e@data, \& this data is serialized and combined with the filename & @include_args \& to create a MD5 checksum to fetch from the cache with. If you wanted \& to cache the results of a search page from form data POSTed, \& then this key could be \& \& { Key => $Request\->Form } \& \& Clear \- If set to 1, or boolean true, will always execute the include \& and update the cache entry for it. .Ve .Sp Motivation: If an include takes 1 second to execute because of complex \s-1SQL\s0 to a database, and you can cache the output of this include because it is not realtime data, and the cache layer runs at .01 seconds, then you have a 100 fold savings on that part of the script. Site scalability can be dramatically increased in this way by intelligently caching bottlenecks in the web application. .Sp Use Sparingly: If you have a fast include, then it may execute faster than the cache layer runs, in which case you may actually slow your site down by using this feature. Therefore try to use this sparingly, and only when sure you really need it. Apache::ASP scripts generally execute very quickly, so most developers will not need to use this feature at all. .ie n .IP "$Response\->Include(\e$script_text, @args)" 4 .el .IP "\f(CW$Response\fR\->Include(\e$script_text, \f(CW@args\fR)" 4 .IX Item "$Response->Include($script_text, @args)" Added in Apache::ASP 2.11, this method allows for executing \s-1ASP\s0 scripts that are generated dynamically by passing in a reference to the script data instead of the file name. This works just like the normal \&\f(CW$Response\fR\->\fIInclude()\fR \s-1API,\s0 except a string reference is passed in instead of a filename. For example: .Sp .Vb 4 \& <% \& my $script = "<\e% print \*(AqTEST\*(Aq; %\e>"; \& $Response\->Include(\e$script); \& %> .Ve .Sp This include would output \s-1TEST.\s0 Note that tokens like <% and %> must be escaped so Apache::ASP does not try to compile those code blocks directly when compiling the original script. If the \f(CW$script\fR data were fetched directly from some external resource like a database, then these tokens would not need to be escaped at all as in: .Sp .Vb 7 \& <% \& my $script = $dbh\->selectrow_array( \& "select script_text from scripts where script_id = ?", \& undef, $script_id \& ); \& $Response\->Include(\e$script); \& %> .Ve .Sp This method could also be used to render other types of dynamic scripts, like \s-1XML\s0 docs using XMLSubs for example, though for complex runtime \s-1XML\s0 rendering, one should use something better suited like \s-1XSLT.\s0 See the \f(CW$Server\fR\->\s-1XSLT API\s0 for more on this topic. .ie n .IP "$Response\->\fIIsClientConnected()\fR" 4 .el .IP "\f(CW$Response\fR\->\fIIsClientConnected()\fR" 4 .IX Item "$Response->IsClientConnected()" \&\s-1API\s0 Extension. 1 for web client still connected, 0 if disconnected which might happen if the user hits the stop button. The original \s-1API\s0 for this \f(CW$Response\fR\->{IsClientConnected} is only updated after a \f(CW$Response\fR\->Flush is called, so this method may be called for a refreshed status. .Sp Note \f(CW$Response\fR\->Flush calls \f(CW$Response\fR\->IsClientConnected to update \f(CW$Response\fR\->{IsClientConnected} so to use this you are going straight to the source! But if you are doing a loop like: .Sp .Vb 6 \& while(@data) { \& $Response\->End if ! $Response\->{IsClientConnected}; \& my $row = shift @data; \& %> <%= $row %> <% \& $Response\->Flush; \& } .Ve .Sp Then its more efficient to use the member instead of the method since \f(CW$Response\fR\->\fIFlush()\fR has already updated that value for you. .ie n .IP "$Response\->Redirect($url)" 4 .el .IP "\f(CW$Response\fR\->Redirect($url)" 4 .IX Item "$Response->Redirect($url)" Sends the client a command to go to a different url \f(CW$url\fR. Script immediately ends. .ie n .IP "$Response\->TrapInclude($file, @args)" 4 .el .IP "\f(CW$Response\fR\->TrapInclude($file, \f(CW@args\fR)" 4 .IX Item "$Response->TrapInclude($file, @args)" Calls \f(CW$Response\fR\->\fIInclude()\fR with same arguments as passed to it, but instead traps the include output buffer and returns it as as a perl string reference. This allows one to postprocess the output buffer before sending to the client. .Sp .Vb 3 \& my $string_ref = $Response\->TrapInclude(\*(Aqfile.inc\*(Aq); \& $$string_ref =~ s/\es+/ /sg; # squash whitespace like Clean 1 \& print $$string_ref; .Ve .Sp The data is returned as a referenece to save on what might be a large string copy. You may dereference the data with the $$string_ref notation. .ie n .IP "$Response\->Write($data)" 4 .el .IP "\f(CW$Response\fR\->Write($data)" 4 .IX Item "$Response->Write($data)" Write output to the \s-1HTML\s0 page. <%=$data%> syntax is shorthand for a \f(CW$Response\fR\->Write($data). All final output to the client must at some point go through this method. .ie n .SS "$Request Object" .el .SS "\f(CW$Request\fP Object" .IX Subsection "$Request Object" The request object manages the input from the client browser, like posts, query strings, cookies, etc. Normal return results are values if an index is specified, or a collection / perl hash ref if no index is specified. \s-1WARNING,\s0 the latter property is not supported in ActiveState PerlScript, so if you use the hashes returned by such a technique, it will not be portable. .PP A normal use of this feature would be to iterate through the form variables in the form hash... .PP .Vb 4 \& $form = $Request\->Form(); \& for(keys %{$form}) { \& $Response\->Write("$_: $form\->{$_}
\en"); \& } .Ve .PP Please see the ./site/eg/server_variables.htm asp file for this method in action. .PP Note that if a form \s-1POST\s0 or query string contains duplicate values for a key, those values will be returned through normal use of the \f(CW$Request\fR object: .PP .Vb 1 \& @values = $Request\->Form(\*(Aqkey\*(Aq); .Ve .PP but you can also access the internal storage, which is an array reference like so: .PP .Vb 2 \& $array_ref = $Request\->{Form}{\*(Aqkey\*(Aq}; \& @values = @{$array_ref}; .Ve .PP Please read the \s-1PERLSCRIPT\s0 section for more information on how things like \f(CW$Request\fR\->\fIQueryString()\fR & \f(CW$Request\fR\->\fIForm()\fR behave as collections. .ie n .IP "$Request\->{Method}" 4 .el .IP "\f(CW$Request\fR\->{Method}" 4 .IX Item "$Request->{Method}" \&\s-1API\s0 extension. Returns the client \s-1HTTP\s0 request method, as in \&\s-1GET\s0 or \s-1POST.\s0 Added in version 2.31. .ie n .IP "$Request\->{TotalBytes}" 4 .el .IP "\f(CW$Request\fR\->{TotalBytes}" 4 .IX Item "$Request->{TotalBytes}" The amount of data sent by the client in the body of the request, usually the length of the form data. This is the same value as \f(CW$Request\fR\->ServerVariables('\s-1CONTENT_LENGTH\s0') .ie n .IP "$Request\->BinaryRead([$length])" 4 .el .IP "\f(CW$Request\fR\->BinaryRead([$length])" 4 .IX Item "$Request->BinaryRead([$length])" Returns a string whose contents are the first \f(CW$length\fR bytes of the form data, or body, sent by the client request. If \f(CW$length\fR is not given, will return all of the form data. This data is the raw data sent by the client, without any parsing done on it by Apache::ASP. .Sp Note that BinaryRead will not return any data for file uploads. Please see the \f(CW$Request\fR\->\fIFileUpload()\fR interface for access to this data. \f(CW$Request\fR\->\fIForm()\fR data will also be available as normal. .ie n .IP "$Request\->\fIClientCertificate()\fR" 4 .el .IP "\f(CW$Request\fR\->\fIClientCertificate()\fR" 4 .IX Item "$Request->ClientCertificate()" Not implemented. .ie n .IP "$Request\->Cookies($name [,$key])" 4 .el .IP "\f(CW$Request\fR\->Cookies($name [,$key])" 4 .IX Item "$Request->Cookies($name [,$key])" Returns the value of the Cookie with name \f(CW$name\fR. If a \f(CW$key\fR is specified, then a lookup will be done on the cookie as if it were a query string. So, a cookie set by: .Sp .Vb 1 \& Set\-Cookie: test=data1=1&data2=2 .Ve .Sp would have a value of 2 returned by \f(CW$Request\fR\->Cookies('test','data2'). .Sp If no name is specified, a hash will be returned of cookie names as keys and cookie values as values. If the cookie value is a query string, it will automatically be parsed, and the value will be a hash reference to these values. .Sp When in doubt, try it out. Remember that unless you set the Expires attribute of a cookie with \f(CW$Response\fR\->Cookies('cookie', 'Expires', \f(CW$xyz\fR), the cookies that you set will only last until you close your browser, so you may find your self opening & closing your browser a lot when debugging cookies. .Sp For more information on cookies in \s-1ASP,\s0 please read \f(CW$Response\fR\->\fICookies()\fR .ie n .IP "$Request\->FileUpload($form_field, $key)" 4 .el .IP "\f(CW$Request\fR\->FileUpload($form_field, \f(CW$key\fR)" 4 .IX Item "$Request->FileUpload($form_field, $key)" \&\s-1API\s0 extension. The FileUpload interface to file upload data is stabilized. The internal representation of the file uploads is a hash of hashes, one hash per file upload found in the \f(CW$Request\fR\->\fIForm()\fR collection. This collection of collections may be queried through the normal interface like so: .Sp .Vb 5 \& $Request\->FileUpload(\*(Aqupload_file\*(Aq, \*(AqContentType\*(Aq); \& $Request\->FileUpload(\*(Aqupload_file\*(Aq, \*(AqFileHandle\*(Aq); \& $Request\->FileUpload(\*(Aqupload_file\*(Aq, \*(AqBrowserFile\*(Aq); \& $Request\->FileUpload(\*(Aqupload_file\*(Aq, \*(AqMime\-Header\*(Aq); \& $Request\->FileUpload(\*(Aqupload_file\*(Aq, \*(AqTempFile\*(Aq); \& \& * note that TempFile must be use with the UploadTempFile \& configuration setting. .Ve .Sp The above represents the old slow collection interface, but like all collections in Apache::ASP, you can reference the internal hash representation more easily. .Sp .Vb 6 \& my $fileup = $Request\->{FileUpload}{upload_file}; \& $fileup\->{ContentType}; \& $fileup\->{BrowserFile}; \& $fileup\->{FileHandle}; \& $fileup\->{Mime\-Header}; \& $fileup\->{TempFile}; .Ve .ie n .IP "$Request\->Form($name)" 4 .el .IP "\f(CW$Request\fR\->Form($name)" 4 .IX Item "$Request->Form($name)" Returns the value of the input of name \f(CW$name\fR used in a form with \s-1POST\s0 method. If \f(CW$name\fR is not specified, returns a ref to a hash of all the form data. One can use this hash to create a nice alias to the form data like: .Sp .Vb 7 \& # in global.asa \& use vars qw( $Form ); \& sub Script_OnStart { \& $Form = $Request\->Form; \& } \& # then in ASP scripts \& <%= $Form\->{var} %> .Ve .Sp File upload data will be loaded into \f(CW$Request\fR\->Form('file_field'), where the value is the actual file name of the file uploaded, and the contents of the file can be found by reading from the file name as a file handle as in: .Sp .Vb 1 \& while(read($Request\->Form(\*(Aqfile_field_name\*(Aq), $data, 1024)) {}; .Ve .Sp For more information, please see the \s-1CGI /\s0 File Upload section, as file uploads are implemented via the \s-1CGI\s0.pm module. An example can be found in the installation samples ./site/eg/file_upload.asp .ie n .IP "$Request\->Params($name)" 4 .el .IP "\f(CW$Request\fR\->Params($name)" 4 .IX Item "$Request->Params($name)" \&\s-1API\s0 extension. If RequestParams \s-1CONFIG\s0 is set, the \f(CW$Request\fR\->Params object is created with combined contents of \f(CW$Request\fR\->QueryString and \f(CW$Request\fR\->Form. This is for developer convenience similar to \s-1CGI\s0.pm's \fIparam()\fR method. Just like for \f(CW$Response\fR\->Form, one could create a nice alias like: .Sp .Vb 5 \& # in global.asa \& use vars qw( $Params ); \& sub Script_OnStart { \& $Params = $Request\->Params; \& } .Ve .ie n .IP "$Request\->QueryString($name)" 4 .el .IP "\f(CW$Request\fR\->QueryString($name)" 4 .IX Item "$Request->QueryString($name)" Returns the value of the input of name \f(CW$name\fR used in a form with \s-1GET\s0 method, or passed by appending a query string to the end of a url as in http://localhost/?data=value. If \f(CW$name\fR is not specified, returns a ref to a hash of all the query string data. .ie n .IP "$Request\->ServerVariables($name)" 4 .el .IP "\f(CW$Request\fR\->ServerVariables($name)" 4 .IX Item "$Request->ServerVariables($name)" Returns the value of the server variable / environment variable with name \f(CW$name\fR. If \f(CW$name\fR is not specified, returns a ref to a hash of all the server / environment variables data. The following would be a common use of this method: .Sp .Vb 2 \& $env = $Request\->ServerVariables(); \& # %{$env} here would be equivalent to the cgi %ENV in perl. .Ve .ie n .SS "$Application Object" .el .SS "\f(CW$Application\fP Object" .IX Subsection "$Application Object" Like the \f(CW$Session\fR object, you may use the \f(CW$Application\fR object to store data across the entire life of the application. Every page in the \s-1ASP\s0 application always has access to this object. So if you wanted to keep track of how many visitors there where to the application during its lifetime, you might have a line like this: .PP .Vb 1 \& $Application\->{num_users}++ .Ve .PP The Lock and Unlock methods are used to prevent simultaneous access to the \f(CW$Application\fR object. .ie n .IP "$Application\->\fILock()\fR" 4 .el .IP "\f(CW$Application\fR\->\fILock()\fR" 4 .IX Item "$Application->Lock()" Locks the Application object for the life of the script, or until \&\fIUnLock()\fR unlocks it, whichever comes first. When \f(CW$Application\fR is locked, this guarantees that data being read and written to it will not suddenly change on you between the reads and the writes. .Sp This and the \f(CW$Session\fR object both lock automatically upon every read and every write to ensure data integrity. This lock is useful for concurrent access control purposes. .Sp Be careful to not be too liberal with this, as you can quickly create application bottlenecks with its improper use. .ie n .IP "$Application\->\fIUnLock()\fR" 4 .el .IP "\f(CW$Application\fR\->\fIUnLock()\fR" 4 .IX Item "$Application->UnLock()" Unlocks the \f(CW$Application\fR object. If already unlocked, does nothing. .ie n .IP "$Application\->GetSession($sess_id)" 4 .el .IP "\f(CW$Application\fR\->GetSession($sess_id)" 4 .IX Item "$Application->GetSession($sess_id)" This NON-PORTABLE \s-1API\s0 extension returns a user \f(CW$Session\fR given a session id. This allows one to easily write a session manager if session ids are stored in \f(CW$Application\fR during Session_OnStart, with full access to these sessions for administrative purposes. .Sp Be careful not to expose full session ids over the net, as they could be used by a hacker to impersonate another user. So when creating a session manager, for example, you could create some other id to reference the SessionID internally, which would allow you to control the sessions. This kind of application would best be served under a secure web server. .Sp The ./site/eg/global_asa_demo.asp script makes use of this routine to display all the data in current user sessions. .ie n .IP "$Application\->\fISessionCount()\fR" 4 .el .IP "\f(CW$Application\fR\->\fISessionCount()\fR" 4 .IX Item "$Application->SessionCount()" This NON-PORTABLE method returns the current number of active sessions in the application, and is enabled by the SessionCount configuration setting. This method is not implemented as part of the original \s-1ASP\s0 object model, but is implemented here because it is useful. In particular, when accessing databases with license requirements, one can monitor usage effectively through accessing this value. .ie n .SS "$Server Object" .el .SS "\f(CW$Server\fP Object" .IX Subsection "$Server Object" The server object is that object that handles everything the other objects do not. The best part of the server object for Win32 users is the CreateObject method which allows developers to create instances of ActiveX components, like the \s-1ADO\s0 component. .ie n .IP "$Server\->{ScriptTimeout} = $seconds" 4 .el .IP "\f(CW$Server\fR\->{ScriptTimeout} = \f(CW$seconds\fR" 4 .IX Item "$Server->{ScriptTimeout} = $seconds" Not implemented. May never be. Please see the Apache Timeout configuration option, normally in httpd.conf. .ie n .IP "$Server\->Config($setting)" 4 .el .IP "\f(CW$Server\fR\->Config($setting)" 4 .IX Item "$Server->Config($setting)" \&\s-1API\s0 extension. Allows a developer to read the \s-1CONFIG\s0 settings, like Global, GlobalPackage, StateDir, etc. Currently implemented as a wrapper around .Sp .Vb 1 \& Apache\->dir_config($setting) .Ve .Sp May also be invoked as \f(CW$Server\fR\->\fIConfig()\fR, which will return a hash ref of all the PerlSetVar settings. .ie n .IP "$Server\->CreateObject($program_id)" 4 .el .IP "\f(CW$Server\fR\->CreateObject($program_id)" 4 .IX Item "$Server->CreateObject($program_id)" Allows use of ActiveX objects on Win32. This routine returns a reference to an Win32::OLE object upon success, and nothing upon failure. It is through this mechanism that a developer can utilize \s-1ADO.\s0 The equivalent syntax in VBScript is .Sp .Vb 1 \& Set object = Server.CreateObject(program_id) .Ve .Sp For further information, try 'perldoc Win32::OLE' from your favorite command line. .ie n .IP "$Server\->Execute($file, @args)" 4 .el .IP "\f(CW$Server\fR\->Execute($file, \f(CW@args\fR)" 4 .IX Item "$Server->Execute($file, @args)" New method from \s-1ASP 3.0,\s0 this does the same thing as .Sp .Vb 1 \& $Response\->Include($file, @args) .Ve .Sp and internally is just a wrapper for such. Seems like we had this important functionality before the \s-1IIS/ASP\s0 camp! .ie n .IP "$Server\->\fIFile()\fR" 4 .el .IP "\f(CW$Server\fR\->\fIFile()\fR" 4 .IX Item "$Server->File()" Returns the absolute file path to current executing script. Same as Apache\->request\->filename when running under mod_perl. .Sp \&\s-1ASP API\s0 extension. .ie n .IP "$Server\->\fIGetLastError()\fR" 4 .el .IP "\f(CW$Server\fR\->\fIGetLastError()\fR" 4 .IX Item "$Server->GetLastError()" Not implemented, will likely not ever be because this is dependent on how \s-1IIS\s0 handles errors and is not relevant in Apache. .ie n .IP "$Server\->HTMLEncode( $string || \e$string )" 4 .el .IP "\f(CW$Server\fR\->HTMLEncode( \f(CW$string\fR || \e$string )" 4 .IX Item "$Server->HTMLEncode( $string || $string )" Returns an \s-1HTML\s0 escapes version of \f(CW$string\fR. &, ", >, <, are each escapes with their \s-1HTML\s0 equivalents. Strings encoded in this nature should be raw text displayed to an end user, as \s-1HTML\s0 tags become escaped with this method. .Sp As of version 2.23, \f(CW$Server\fR\->\fIHTMLEncode()\fR may take a string reference for an optimization when encoding a large buffer as an \s-1API\s0 extension. Here is how one might use one over the other: .Sp .Vb 7 \& my $buffer = \*(Aq&\*(Aq x 100000; \& $buffer = $Server\->HTMLEncode($buffer); \& print $buffer; \& \- or \- \& my $buffer = \*(Aq&\*(Aq x 100000; \& $Server\->HTMLEncode(\e$buffer); \& print $buffer; .Ve .Sp Using the reference passing method in benchmarks on 100K of data was 5% more efficient, but maybe useful for some. It saves on copying the 100K buffer twice. .ie n .IP "$Server\->MapInclude($include)" 4 .el .IP "\f(CW$Server\fR\->MapInclude($include)" 4 .IX Item "$Server->MapInclude($include)" \&\s-1API\s0 extension. Given the include \f(CW$include\fR, as an absolute or relative file name to the current executing script, this method returns the file path that the include would be found from the include search path. The include search path is the current script directory, Global, and IncludesDir directories. .Sp If the include is not found in the includes search path, then undef, or bool false, is returned. So one may do something like this: .Sp .Vb 3 \& if($Server\->MapInclude(\*(Aqinclude.inc\*(Aq)) { \& $Response\->Include(\*(Aqinclude.inc\*(Aq); \& } .Ve .Sp This code demonstrates how one might only try to execute an include if it exists, which is useful since a script will error if it tries to execute an include that does not exist. .ie n .IP "$Server\->MapPath($url);" 4 .el .IP "\f(CW$Server\fR\->MapPath($url);" 4 .IX Item "$Server->MapPath($url);" Given the url \f(CW$url\fR, absolute, or relative to the current executing script, this method returns the equivalent filename that the server would translate the request to, regardless or whether the request would be valid. .Sp Only a \f(CW$url\fR that is relative to the host is valid. Urls like \*(L".\*(R" and \&\*(L"/\*(R" are fine arguments to MapPath, but http://localhost would not be. .Sp To see this method call in action, check out the sample ./site/eg/server.htm script. .ie n .IP "$Server\->Mail(\e%mail, %smtp_args);" 4 .el .IP "\f(CW$Server\fR\->Mail(\e%mail, \f(CW%smtp_args\fR);" 4 .IX Item "$Server->Mail(%mail, %smtp_args);" With the Net::SMTP and Net::Config modules installed, which are part of the perl libnet package, you may use this \s-1API\s0 extension to send email. The \&\e%mail hash reference that you pass in must have values for at least the To, From, and Subject headers, and the Body of the mail message. .Sp The return value of this routine is 1 for success, 0 for failure. If the MailHost \&\s-1SMTP\s0 server is not available, this will have a return value of 0. .Sp You could send an email like so: .Sp .Vb 12 \& $Server\->Mail({ \& To => \*(Aqsomebody@yourdomain.com.foobar\*(Aq, \& From => \*(Aqyouremail@yourdomain.com.foobar\*(Aq, \& Subject => \*(AqSubject of Email\*(Aq, \& Body => \& \*(AqBody of message. \*(Aq. \& \*(AqYou might have a lot to say here!\*(Aq, \& Organization => \*(AqYour Organization\*(Aq, \& CC => \*(Aqyouremailcc@yourdomain.com.foobar\*(Aq, \& BCC => \*(Aqyouremailbcc@yourdomain.com.foobar\*(Aq, \& Debug => 0 || 1, \& }); .Ve .Sp Any extra fields specified for the email will be interpreted as headers for the email, so to send an \s-1HTML\s0 email, you could set 'Content\-Type' => 'text/html' in the above example. .Sp If you have MailFrom configured, this will be the default for the From header in your email. For more configuration options like the MailHost setting, check out the \s-1CONFIG\s0 section. .Sp The return value of this method call will be boolean for success of the mail being sent. .Sp If you would like to specially configure the Net::SMTP object used internally, you may set \f(CW%smtp_args\fR and they will be passed on when that object is initialized. \&\*(L"perldoc Net::SMTP\*(R" for more into on this topic. .Sp If you would like to include the output of an \s-1ASP\s0 page as the body of the mail message, you might do something like: .Sp .Vb 2 \& my $mail_body = $Response\->TrapInclude(\*(Aqmail_body.inc\*(Aq); \& $Server\->Mail({ %mail, Body => $$mail_body }); .Ve .ie n .IP "$Server\->RegisterCleanup($sub)" 4 .el .IP "\f(CW$Server\fR\->RegisterCleanup($sub)" 4 .IX Item "$Server->RegisterCleanup($sub)" .Vb 1 \& non\-portable extension .Ve .Sp Sets a subroutine reference to be executed after the script ends, whether normally or abnormally, the latter occurring possibly by the user hitting the \s-1STOP\s0 button, or the web server being killed. This subroutine must be a code reference created like: .Sp .Vb 4 \& $Server\->RegisterCleanup(sub { $main::Session\->{served}++; }); \& or \& sub served { $main::Session\->{served}++; } \& $Server\->RegisterCleanup(\e&served); .Ve .Sp The reference to the subroutine passed in will be executed. Though the subroutine will be executed in anonymous context, instead of the script, all objects will still be defined in main::*, that you would reference normally in your script. Output written to \f(CW$main::Response\fR will have no affect at this stage, as the request to the www client has already completed. .Sp Check out the ./site/eg/register_cleanup.asp script for an example of this routine in action. .ie n .IP "$Server\->Transfer($file, @args)" 4 .el .IP "\f(CW$Server\fR\->Transfer($file, \f(CW@args\fR)" 4 .IX Item "$Server->Transfer($file, @args)" New method from \s-1ASP 3.0.\s0 Transfers control to another script. The Response buffer will not be cleared automatically, so if you want this to serve as a faster \f(CW$Response\fR\->\fIRedirect()\fR, you will need to call \f(CW$Response\fR\->\fIClear()\fR before calling this method. .Sp This new script will take over current execution and the current script will not continue to be executed afterwards. It differs from \fIExecute()\fR because the original script will not pick up where it left off. .Sp As of Apache::ASP 2.31, this method now accepts optional arguments like \f(CW$Response\fR\->Include & \f(CW$Server\fR\->Execute. \&\f(CW$Server\fR\->Transfer is now just a wrapper for: .Sp .Vb 2 \& $Response\->Include($file, @args); \& $Response\->End; .Ve .ie n .IP "$Server\->URLEncode($string)" 4 .el .IP "\f(CW$Server\fR\->URLEncode($string)" 4 .IX Item "$Server->URLEncode($string)" Returns the URL-escaped version of the string \f(CW$string\fR. +'s are substituted in for spaces and special characters are escaped to the ascii equivalents. Strings encoded in this manner are safe to put in urls... they are especially useful for encoding data used in a query string as in: .Sp .Vb 2 \& $data = $Server\->URLEncode("test data"); \& $url = "http://localhost?data=$data"; \& \& $url evaluates to http://localhost?data=test+data, and is a \& valid URL for use in anchor tags and redirects, etc. .Ve .ie n .IP "$Server\->\s-1URL\s0($url, \e%params)" 4 .el .IP "\f(CW$Server\fR\->\s-1URL\s0($url, \e%params)" 4 .IX Item "$Server->URL($url, %params)" Will return a \s-1URL\s0 with \f(CW%params\fR serialized into a query string like: .Sp .Vb 1 \& $url = $Server\->URL(\*(Aqtest.asp\*(Aq, { test => value }); .Ve .Sp which would give you a \s-1URL\s0 of test.asp?test=value .Sp Used in conjunction with the SessionQuery* settings, the returned \&\s-1URL\s0 will also have the session id inserted into the query string, making this a critical part of that method of implementing cookieless sessions. For more information on that topic please read on the setting in the \s-1CONFIG\s0 section, and the \s-1SESSIONS\s0 section too. .ie n .IP "$Server\->\s-1XSLT\s0(\e$xsl_data, \e$xml_data)" 4 .el .IP "\f(CW$Server\fR\->\s-1XSLT\s0(\e$xsl_data, \e$xml_data)" 4 .IX Item "$Server->XSLT($xsl_data, $xml_data)" .Vb 1 \& * NON\-PORTABLE API EXTENSION * .Ve .Sp This method takes string references for \s-1XSL\s0 and \s-1XML\s0 data and returns the \s-1XSLT\s0 output as a string reference like: .Sp .Vb 2 \& my $xslt_data_ref = $Server\->XSLT(\e$xsl_data, \e$xml_data) \& print $$xslt_data_ref; .Ve .Sp The \s-1XSLT\s0 parser defaults to \s-1XML::XSLT,\s0 and is configured with the XSLTParser setting, which can also use XML::Sablotron ( support added in 2.11 ), and XML::LibXSLT ( support added in 2.29 ). Please see the \s-1CONFIG\s0 section for more information on the XSLT* settings that drive this \s-1API.\s0 The \s-1XSLT\s0 setting itself uses this \s-1API\s0 internally to do its rendering. .Sp This \s-1API\s0 was created to allow developers easy \s-1XSLT\s0 component rendering without having to render the entire \s-1ASP\s0 scripts via \s-1XSLT.\s0 This will make an easy plugin architecture for those looking to integrate \s-1XML\s0 into their existing \s-1ASP\s0 application frameworks. .Sp At some point, the \s-1API\s0 will likely take files as arguments, but not as of the 2.11 release. .SH "SSI" .IX Header "SSI" \&\s-1SSI\s0 is great! One of the main features of server side includes is to include other files in the script being requested. In Apache::ASP, this is implemented in a couple ways, the most crucial of which is implemented in the file include. Formatted as .PP .Vb 1 \& .Ve .PP ,the .inc being merely a convention, text from the included file will be inserted directly into the script being executed and the script will be compiled as a whole. Whenever the script or any of its includes change, the script will be recompiled. .PP Includes go a great length to promote good decomposition and code sharing in \s-1ASP\s0 scripts, but they are still fairly static. As of version .09, includes may have dynamic runtime execution, as subroutines compiled into the global.asa namespace. The first way to invoke includes dynamically is .PP .Vb 1 \& .Ve .PP If \f(CW@args\fR is specified, Apache::ASP knows to execute the include at runtime instead of inlining it directly into the compiled code of the script. It does this by compiling the script at runtime as a subroutine, and caching it for future invocations. Then the compiled subroutine is executed and has \f(CW@args\fR passed into its as arguments. .PP This is still might be too static for some, as \f(CW@args\fR is still hardcoded into the \s-1ASP\s0 script, so finally, one may execute an include at runtime by utilizing this \s-1API\s0 extension .PP .Vb 1 \& $Response\->Include("filename.inc", @args); .Ve .PP which is a direct translation of the dynamic include above. .PP Although inline includes should be a little faster, runtime dynamic includes represent great potential savings in httpd memory, as includes are shared between scripts keeping the size of each script to a minimum. This can often be significant saving if much of the formatting occurs in an included header of a www page. .PP By default, all includes will be inlined unless called with an args parameter. However, if you want all your includes to be compiled as subs and dynamically executed at runtime, turn the DynamicIncludes config option on as documented above. .SS "Apache::SSI for mod_perl 1.3.x only" .IX Subsection "Apache::SSI for mod_perl 1.3.x only" One of the things missing above is the .PP .Vb 1 \& .Ve .PP tag. This and many other \s-1SSI\s0 code extensions are available by filtering Apache::ASP output through Apache::SSI via the Apache::Filter and the Filter config options, available in mod_perl 1.3.x / Apache 1.3.x. Unfortunately this functionality is not available with mod_perl 2 / Apache 2. .PP For more information on how to wire Apache::ASP and Apache::SSI together, please see the Filter config option documented above. Also please see Apache::SSI for further information on the capabilities it offers. .SS "\s-1SSI\s0 with mod_filter in Apache 2" .IX Subsection "SSI with mod_filter in Apache 2" Apache 2 offers chained filters. It may be possible to chain filters to Apache::ASP output through mod_filter for \s-1SSI\s0 processing: .PP .Vb 1 \& http://httpd.apache.org/docs/2.1/mod/mod_filter.html .Ve .SH "EXAMPLES" .IX Header "EXAMPLES" Use with Apache. Copy the ./site/eg directory from the \s-1ASP\s0 installation to your Apache document tree and try it out! You have to put \&\*(L"AllowOverride All\*(R" in your config section to let the \&.htaccess file in the ./site/eg installation directory do its work. .PP \&\s-1IMPORTANT\s0 (\s-1FAQ\s0): Make sure that the web server has write access to that directory. Usually a .PP .Vb 1 \& chmod \-R 0777 eg .Ve .PP will do the trick :) .SH "SESSIONS" .IX Header "SESSIONS" Cookies are used by default for user \f(CW$Session\fR support ( see \s-1OBJECTS\s0 ). In order to track a web user and associate server side data with that client, the web server sets, and the web client returns a 32 byte session id identifier cookie. This implementation is very secure and may be used in secure \s-1HTTPS\s0 transactions, and made stronger with SecureSession, HTTPOnlySession and ParanoidSession settings (see \s-1CONFIG\s0 ). .PP However good cookies are for this kind of persistent state management between \s-1HTTP\s0 requests, they have long been under fire for security risks associated with JavaScript security exploits and privacy abuse by large data tracking companies. .PP Because of these reasons, web users will sometimes turn off their cookies, rendering normal \s-1ASP\s0 session implementations powerless, resulting in a new \f(CW$Session\fR generated every request. This is not good for \s-1ASP\s0 style sessions. .SS "Cookieless Sessions" .IX Subsection "Cookieless Sessions" .Vb 1 \& *** See WARNING Below *** .Ve .PP So we now have more ways to track sessions with the SessionQuery* \s-1CONFIG\s0 settings, that allow a web developer to embed the session id in \s-1URL\s0 query strings when use of cookies is denied. The implementations work such that if a user has cookies turned on, then cookies will be used, but for those users with cookies turned off, the session ids will be parsed into document URLs. .PP The first and easiest method that a web developer may use to implement cookieless sessions are with SessionQueryParse* directives which enable Apache::ASP to the parse the session id into document URLs on the fly. Because this is resource inefficient, there is also the SessionQuery* directives that may be used with the \f(CW$Server\fR\->\s-1URL\s0($url,\e%params) method to generate custom URLs with the session id in its query string. .PP To see an example of these cookieless sessions in action, check out the ./site/eg/session_query_parse.asp example. .PP .Vb 1 \& *** WARNING *** .Ve .PP If you do use these methods, then be \s-1VERY CAREFUL\s0 of linking offsite from a page that was accessed with a session id in a query string. This is because this session id will show up in the \s-1HTTP_REFERER\s0 logs of the linked to site, and a malicious hacker could use this information to compromise the security of your site's \f(CW$Sessions\fR, even if these are run under a secure web server. .PP In order to shake a session id off an \s-1HTTP_REFERER\s0 for a link taking a user offsite, you must point that link to a redirect page that will redirect a user, like so: .PP .Vb 10 \& <% \& # "cross site scripting bug" prevention \& my $sanitized_url = \& $Server\->HTMLEncode($Response\->QueryString(\*(AqOffSiteUrl\*(Aq)); \& %> \& \& \& \*(Aq> \& \& \& Redirecting you offsite to \& >here... \& \& .Ve .PP Because the web browser visits a real page before being redirected with the tag, the \s-1HTTP_REFERER\s0 will be set to this page. Just be sure to not link to this page with a session id in its query string. .PP Unfortunately a simple \f(CW$Response\fR\->\fIRedirect()\fR will not work here, because the web browser will keep the \s-1HTTP_REFERER\s0 of the original web page if only a normal redirect is used. .SH "XML/XSLT" .IX Header "XML/XSLT" .SS "Custom Tags with XMLSubsMatch" .IX Subsection "Custom Tags with XMLSubsMatch" Before \s-1XML,\s0 there was the need to make \s-1HTML\s0 markup smarter. Apache::ASP gives you the ability to have a perl subroutine handle the execution of any predefined tag, taking the tag descriptors, and the text contained between, as arguments of the subroutine. This custom tag technology can be used to extend a web developer's abilities to add dynamic pieces without having to visibly use <% %> style code entries. .PP So, lets say that you have a table that you want to insert for an employee with contact info and the like, you could set up a tag like: .PP .Vb 3 \& \& Jane Doe has been here since 1998. \& .Ve .PP To render it with a custom tag, you would tell the Apache::ASP parser to render the tag with a subroutine: .PP .Vb 1 \& PerlSetVar XMLSubsMatch my:new\-employee .Ve .PP Any colons, ':', in the \s-1XML\s0 custom tag will turn into '::', a perl package separator, so the my:employee tag would translate to the my::employee subroutine, or the employee subroutine in the my package. Any dash \*(L"\-\*(R" will also be translated to an underscore \*(L"_\*(R", as dash is not valid in the names of perl subroutines. .PP Then you would create the my::employee subroutine in the my perl package or wherever like so: .PP .Vb 6 \& package my; \& sub new_employee { \& my($attributes, $body) = @_; \& $main::Response\->Include(\*(Aqnew_employee.inc\*(Aq, $attributes, $body); \& } \& 1; \& \& \& <% my($attributes, $body) = @_; %> \& \& <% for(\*(Aqname\*(Aq, \*(Aqlast\*(Aq, \*(Aqphone\*(Aq) { %> \& \& \& \& \& <% } %> \& \&
<%=ucfirst $_ %>:<%= $attributes\->{$_} %>
<%= $body %>
\& .Ve .PP The \f(CW$main::Response\fR\->\fIInclude()\fR would then delegate the rendering of the new-employee to the new_employee.inc \s-1ASP\s0 script include. .PP Though \s-1XML\s0 purists would not like this custom tag technology to be related to \s-1XML,\s0 the reality is that a careful site engineer could render full \s-1XML\s0 documents with this technology, applying all the correct styles that one might otherwise do with \s-1XSLT.\s0 .PP Custom tags defined in this way can be used as \s-1XML\s0 tags are defined with both a body and without as it .PP .Vb 1 \& ... .Ve .PP and just .PP .Vb 1 \& .Ve .PP These tags are very powerful in that they can also enclose normal \s-1ASP\s0 logic, like: .PP .Vb 3 \& \& \& <% my $birthday = &HTTP::Date::time2str(time \- 25 * 86400 * 365); %> \& \& \& This employee has been online for <%= int(rand()*600)+1 %> \& seconds, and was born near <%= $birthday %>. \& .Ve .PP For an example of this custom \s-1XML\s0 tagging in action, please check out the ./site/eg/xml_subs.asp script. .SS "\s-1XSLT\s0 Tranformations" .IX Subsection "XSLT Tranformations" \&\s-1XML\s0 is good stuff, but what can you use it for? The principle is that by having data and style separated in \s-1XML\s0 and \s-1XSL\s0 files, you can reformat your data more easily in the future, and you can render your data in multiple formats, just as easily as for your web site, so you might render your site to a \s-1PDA,\s0 or a cell phone just as easily as to a browser, and all you have to do is set up the right \s-1XSL\s0 stylesheets to do the transformation (\s-1XSLT\s0). .PP With native \s-1XML/XSLT\s0 support, Apache::ASP scripts may be the source of \s-1XML\s0 data that the \s-1XSL\s0 file transforms, and the \s-1XSL\s0 file itself will be first executed as an \s-1ASP\s0 script also. The \s-1XSLT\s0 transformation is handled by \s-1XML::XSLT\s0 or XML::Sablotron and you can see an example of it in action at the ./site/eg/xslt.xml \s-1XML\s0 script. .PP To specify a \s-1XSL\s0 stylesheet, use the setting: .PP .Vb 1 \& PerlSetVar XSLT template.xsl .Ve .PP where template.xsl could be any file. By default this will \&\s-1XSLT\s0 transform all \s-1ASP\s0 scripts so configured, but you can separate xml scripts from the rest with the setting: .PP .Vb 1 \& PerlSetVar XSLTMatch xml$ .Ve .PP where all files with the ending xml would undergo a \s-1XSLT\s0 transformation. .PP Note that \s-1XSLT\s0 depends on the installation of \s-1XML::XSLT,\s0 which in turn depends on \s-1XML::DOM,\s0 and XML::Parser. As of version 2.11, XML::Sablotron may also be used by setting: .PP .Vb 1 \& PerlSetVar XSLTParser XML::Sablotron .Ve .PP and XML::LibXSLT may be used, as of 2.29, by setting .PP .Vb 1 \& PerlSetVar XSLTParser XML::LibXSLT .Ve .PP If you would like to install XML::Sablotron or XML::LibXSLT, you will first have to install the libraries that these perl modules use, which you can get at: .PP .Vb 2 \& libxslt \- The XSLT C Library for Gnome \& http://xmlsoft.org/XSLT/ \& \& Sablotron \- Ginger Alliance \& http://www.gingerall.com .Ve .PP For more on \s-1XML::XSLT,\s0 the default \s-1XSLT\s0 engine that Apache::ASP will use, please see: .PP .Vb 2 \& XML::XSLT \& http://xmlxslt.sourceforge.net/ .Ve .PP \&\s-1XML:XSLT\s0 was the first supported \s-1XSLT\s0 engine as has the benefit of being written in pure perl so that though while it is slower than the other solutions, it is easier to port. .PP If you would like to cache \s-1XSLT\s0 transformations, which is highly recommended, just set: .PP .Vb 1 \& PerlSetVar XSLTCache 1 .Ve .PP Please see the Cache settings in the \s-1CONFIG\s0 section for more about how to configure the XSLTCache. .SS "References" .IX Subsection "References" For more information about \s-1XSLT,\s0 please see the standard at: .PP .Vb 1 \& http://www.w3.org/TR/xslt .Ve .PP For their huge ground breaking \s-1XML\s0 efforts, these other \s-1XML OSS\s0 projects need mention: .PP .Vb 2 \& Cocoon \- XML\-based web publishing, in Java \& http://cocoon.apache.org/ \& \& AxKit \- XML web publishing with Apache & mod_perl \& http://www.axkit.org/ .Ve .SH "CGI" .IX Header "CGI" \&\s-1CGI\s0 has been the standard way of deploying web applications long before \&\s-1ASP\s0 came along. In the \s-1CGI\s0 gateway world, \s-1CGI\s0.pm has been a widely used module in building \s-1CGI\s0 applications, and Apache::ASP is compatible with scripts written with \s-1CGI\s0.pm. Also, as of version 2.19, Apache::ASP can run in standalone \s-1CGI\s0 mode for the Apache web server without mod_perl being available. See \*(L"Standalone \s-1CGI\s0 Mode\*(R" section below. .PP Following are some special notes with respect to compatibility with \s-1CGI\s0 and \s-1CGI\s0.pm. Use of \s-1CGI\s0.pm in any of these ways was made possible through a great amount of work, and is not guaranteed to be portable with other perl \&\s-1ASP\s0 implementations, as other \s-1ASP\s0 implementations will likely be more limited. .IP "Standalone \s-1CGI\s0 Mode, without mod_perl" 4 .IX Item "Standalone CGI Mode, without mod_perl" As of version 2.19, Apache::ASP scripts may be run as standalone \&\s-1CGI\s0 scripts without mod_perl being loaded into Apache. Work to date has only been done with mod_cgi scripts under Apache on a Unix platform, and it is unlikely to work under other web servers or Win32 operating systems without further development. .Sp To run the ./site/eg scripts as \s-1CGI\s0 scripts, you copy the \&./site directory to some location accessible by your web server, in this example its /usr/local/apache/htdocs/aspcgi, then in your httpd.conf activate Apache::ASP cgi scripts like so: .Sp .Vb 10 \& Alias /aspcgi/ /usr/local/apache/htdocs/aspcgi/ \& \& AddType application/x\-httpd\-cgi .htm \& AddType application/x\-httpd\-cgi .html \& AddType application/x\-httpd\-cgi .asp \& AddType application/x\-httpd\-cgi .xml \& AddType application/x\-httpd\-cgi .ssi \& AllowOverride None \& Options +ExecCGI +Indexes \& .Ve .Sp Then install the asp-perl script from the distribution into /usr/bin, or some other directory. This is so the \s-1CGI\s0 execution line at the top of those scripts will invoke the asp-perl wrapper like so: .Sp .Vb 1 \& #!/usr/bin/perl /usr/bin/asp\-perl .Ve .Sp The asp-perl script is a cgi wrapper that sets up the Apache::ASP environment in lieu of the normal mod_perl handler request. Because there is no Apache\->\fIdir_config()\fR data available under mod_cgi, the asp-perl script will load a asp.conf file that may define a hash \f(CW%Config\fR of data for populating the \fIdir_config()\fR data. An example of a complex asp.conf file is at ./site/eg/asp.conf .Sp So, a trivial asp.conf file might look like: .Sp .Vb 7 \& # asp.conf \& %Config = ( \& \*(AqGlobal\*(Aq => \*(Aq.\*(Aq, \& \*(AqStateDir\*(Aq => \*(Aq/tmp/aspstate\*(Aq, \& \*(AqNoState\*(Aq => 0, \& \*(AqDebug\*(Aq => 3, \& ); .Ve .Sp The default for NoState is 1 in \s-1CGI\s0 mode, so one must set NoState to 0 for objects like \f(CW$Session\fR & \f(CW$Application\fR to be defined. .IP "\s-1CGI\s0.pm" 4 .IX Item "CGI.pm" \&\s-1CGI\s0.pm is a very useful module that aids developers in the building of these applications, and Apache::ASP has been made to be compatible with function calls in \s-1CGI\s0.pm. Please see cgi.htm in the \&./site/eg directory for a sample \s-1ASP\s0 script written almost entirely in \s-1CGI.\s0 .Sp As of version 0.09, use of \s-1CGI\s0.pm for both input and output is seamless when working under Apache::ASP. Thus if you would like to port existing cgi scripts over to Apache::ASP, all you need to do is wrap <% %> around the script to get going. This functionality has been implemented so that developers may have the best of both worlds when building their web applications. .Sp For more information about \s-1CGI\s0.pm, please see the web site .Sp .Vb 1 \& http://search.cpan.org/dist/CGI/ .Ve .IP "Query Object Initialization" 4 .IX Item "Query Object Initialization" You may create a \s-1CGI\s0.pm \f(CW$query\fR object like so: .Sp .Vb 2 \& use CGI; \& my $query = new CGI; .Ve .Sp As of Apache::ASP version 0.09, form input may be read in by \s-1CGI\s0.pm upon initialization. Before, Apache::ASP would consume the form input when reading into \f(CW$Request\fR\->\fIForm()\fR, but now form input is cached, and may be used by \s-1CGI\s0.pm input routines. .IP "\s-1CGI\s0 headers" 4 .IX Item "CGI headers" Not only can you use the \s-1CGI\s0.pm \f(CW$query\fR\->\fIheader()\fR method to put out headers, but with the CgiHeaders config option set to true, you can also print \*(L"Header: value\en\*(R", and add similar lines to the top of your script, like: .Sp .Vb 2 \& Some\-Header: Value \& Some\-Other: OtherValue \& \& Script body starts here. .Ve .Sp Once there are no longer any cgi style headers, or the there is a newline, the body of the script begins. So if you just had an asp script like: .Sp .Vb 1 \& print join(":", %{$Request\->QueryString}); .Ve .Sp You would likely end up with no output, as that line is interpreted as a header because of the semicolon. When doing basic debugging, as long as you start the page with you will avoid this problem. .IP "\fIprint()\fRing \s-1CGI\s0" 4 .IX Item "print()ing CGI" \&\s-1CGI\s0 is notorious for its \fIprint()\fR statements, and the functions in \s-1CGI\s0.pm usually return strings to \fIprint()\fR. You can do this under Apache::ASP, since print just aliases to \f(CW$Response\fR\->\fIWrite()\fR. Note that $| has no affect. .Sp .Vb 2 \& print $query\->header(); \& print $query\->start_form(); .Ve .IP "File Upload" 4 .IX Item "File Upload" \&\s-1CGI\s0.pm is used for implementing reading the input from file upload. You may create the file upload form however you wish, and then the data may be recovered from the file upload by using \f(CW$Request\fR\->\fIForm()\fR. Data from a file upload gets written to a file handle, that may in turn be read from. The original file name that was uploaded is the name of the file handle. .Sp .Vb 6 \& my $filehandle = $Request\->Form(\*(Aqfile_upload_field_name\*(Aq); \& print $filehandle; # will get you the file name \& my $data; \& while(read($filehandle, $data, 1024)) { \& # data from the uploaded file read into $data \& }; .Ve .Sp Please see the docs on \s-1CGI\s0.pm (try perldoc \s-1CGI\s0) for more information on this topic, and ./site/eg/file_upload.asp for an example of its use. Also, for more details about \s-1CGI\s0.pm itself, please see the web site: .Sp .Vb 1 \& http://search.cpan.org/dist/CGI/ .Ve .Sp Occasionally, a newer version of \s-1CGI\s0.pm will be released which breaks file upload compatibility with Apache::ASP. If you find this to occur, then you might consider downgrading to a version that works. For example, one can install a working \s-1CGI\s0.pm v2.78 for a working version, and to get old versions of this module, one can go to \s-1BACKPAN\s0 at: .Sp .Vb 1 \& http://backpan.cpan.org/modules/by\-authors/id/L/LD/LDS/ .Ve .Sp There is also \f(CW$Request\fR\->\fIFileUpload()\fR \s-1API\s0 extension that you can use to get more data about a file upload, so that the following properties are available for querying: .Sp .Vb 4 \& my $file_upload = $Request\->{FileUpload}{upload_field}; \& $file_upload\->{BrowserFile} \& $file_upload\->{FileHandle} \& $file_upload\->{ContentType} \& \& # only if FileUploadTemp is set \& $file_upload\->{TempFile} \& \& # whatever mime headers are sent with the file upload \& # just "keys %$file_upload" to find out \& $file_upload\->{?Mime\-Header?} .Ve .Sp Please see the \f(CW$Request\fR section in \s-1OBJECTS\s0 for more information. .SH "PERLSCRIPT" .IX Header "PERLSCRIPT" Much work has been done to bring compatibility with \s-1ASP\s0 applications written in PerlScript under \s-1IIS.\s0 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. .PP New as of version 2.05 is new functionality enabled with the CollectionItem setting, to giver better support to more recent PerlScript syntax. This seems helpful when porting from an IIS/PerlScript code base. Please see the \s-1CONFIG\s0 section for more info. .PP The following objects in Apache::ASP respond as Collections: .PP .Vb 9 \& $Application \& $Session \& $Request\->FileUpload * \& $Request\->FileUpload(\*(Aqupload_file\*(Aq) * \& $Request\->Form \& $Request\->QueryString \& $Request\->Cookies \& $Response\->Cookies \& $Response\->Cookies(\*(Aqsome_cookie\*(Aq) \& \& * FileUpload API Extensions .Ve .PP 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. .PP .Vb 1 \& C = PerlScript Compatibility N = Native Apache::ASP \& \& ## Collection\->Contents($name) \& [C] $Application\->Contents(\*(AqXYZ\*(Aq) \& [N] $Application\->{XYZ} \& \& ## Collection\->SetProperty($property, $name, $value) \& [C] $Application\->Contents\->SetProperty(\*(AqItem\*(Aq, \*(AqXYZ\*(Aq, "Fred"); \& [N] $Application\->{XYZ} = "Fred" \& \& ## Collection\->GetProperty($property, $name) \& [C] $Application\->Contents\->GetProperty(\*(AqItem\*(Aq, \*(AqXYZ\*(Aq) \& [N] $Application\->{XYZ} \& \& ## Collection\->Item($name) \& [C] print $Request\->QueryString\->Item(\*(Aqmessage\*(Aq), "
\en\en"; \& [N] print $Request\->{QueryString}{\*(Aqmessage\*(Aq}, "
\en\en"; \& \& ## Working with Cookies \& [C] $Response\->SetProperty(\*(AqCookies\*(Aq, \*(AqTesting\*(Aq, \*(AqExtra\*(Aq); \& [C] $Response\->SetProperty(\*(AqCookies\*(Aq, \*(AqTesting\*(Aq, {\*(AqPath\*(Aq => \*(Aq/\*(Aq}); \& [C] print $Request\->Cookies(Testing) . "
\en"; \& [N] $Response\->{Cookies}{Testing} = {Value => Extra, Path => \*(Aq/\*(Aq}; \& [N] print $Request\->{Cookies}{Testing} . "
\en"; .Ve .PP Several incompatibilities exist between PerlScript and Apache::ASP: .PP .Vb 4 \& > 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. \& > The \->{Item} property does not work, use the \->Item() method. .Ve .SH "STYLE GUIDE" .IX Header "STYLE GUIDE" Here are some general style guidelines. Treat these as tips for best practices on Apache::ASP development if you will. .SS "UseStrict" .IX Subsection "UseStrict" One of perl's blessings is also its bane, variables do not need to be declared, and are by default globally scoped. The problem with this in mod_perl is that global variables persist from one request to another even if a different web browser is viewing a page. .PP To avoid this problem, perl programmers have often been advised to add to the top of their perl scripts: .PP .Vb 1 \& use strict; .Ve .PP In Apache::ASP, you can do this better by setting: .PP .Vb 1 \& PerlSetVar UseStrict 1 .Ve .PP which will cover both script & global.asa compilation and will catch \&\*(L"use strict\*(R" errors correctly. For perl modules, please continue to add \*(L"use strict\*(R" to the top of them. .PP Because its so essential in catching hard to find errors, this configuration will likely become the default in some future release. For now, keep setting it. .SS "Do not define subroutines in scripts." .IX Subsection "Do not define subroutines in scripts." \&\s-1DO NOT\s0 add subroutine declarations in scripts. Apache::ASP is optimized by compiling a script into a subroutine for faster future invocation. Adding a subroutine definition to a script then looks like this to the compiler: .PP .Vb 9 \& sub page_script_sub { \& ... \& ... some HTML ... \& ... \& sub your_sub { \& ... \& } \& ... \& } .Ve .PP The biggest problem with subroutines defined in subroutines is the side effect of creating closures, which will not behave as usually desired in a mod_perl environment. To understand more about closures, please read up on them & \*(L"Nested Subroutines\*(R" at: .PP .Vb 1 \& http://perl.apache.org/docs/general/perl_reference/perl_reference.html .Ve .PP Instead of defining subroutines in scripts, you may add them to your sites global.asa, or you may create a perl package or module to share with your scripts. For more on perl objects & modules, please see: .PP .Vb 1 \& http://perldoc.perl.org/perlobj.html .Ve .SS "Use global.asa's Script_On* Events" .IX Subsection "Use global.asa's Script_On* Events" Chances are that you will find yourself doing the same thing repeatedly in each of your web application's scripts. You can use Script_OnStart and Script_OnEnd to automate these routine tasks. These events are called before and after each script request. .PP For example, let's say you have a header & footer you would like to include in the output of every page, then you might: .PP .Vb 7 \& # global.asa \& sub Script_OnStart { \& $Response\->Include(\*(Aqheader.inc\*(Aq); \& } \& sub Script_OnEnd { \& $Response\->Include(\*(Aqfooter.inc\*(Aq); \& } .Ve .PP Or let's say you want to initialize a global database connection for use in your scripts: .PP .Vb 3 \& # global.asa \& use Apache::DBI; # automatic persistent database connections \& use DBI; \& \& use vars qw($dbh); # declare global $dbh \& \& sub Script_OnStart { \& # initialize $dbh \& $dbh = DBI\->connect(...); \& \& # force you to explicitly commit when you want to save data \& $Server\->RegisterCleanup(sub { $dbh\->rollback; }); \& } \& \& sub Script_OnEnd { \& # not really necessary when using persistent connections, but \& # will free this one object reference at least \& $dbh = undef; \& } .Ve .SH "FAQ" .IX Header "FAQ" The following are some frequently asked questions about Apache::ASP. .SS "Installation" .IX Subsection "Installation" .IP "Examples don't work, I see the \s-1ASP\s0 script in the browser?" 4 .IX Item "Examples don't work, I see the ASP script in the browser?" This is most likely that Apache is not configured to execute the Apache::ASP scripts properly. Check the \s-1INSTALL\s0 QuickStart section for more info on how to quickly set up Apache to execute your \s-1ASP\s0 scripts. .IP "Apache Expat vs. \s-1XML\s0 perl parsing causing segfaults, what do I do?" 4 .IX Item "Apache Expat vs. XML perl parsing causing segfaults, what do I do?" Make sure to compile apache with expat disabled. The \&./make_httpd/build_httpds.sh in the distribution will do this for you, with the \-\-disable\-rule=EXPAT in particular: .Sp .Vb 9 \& cd ../$APACHE \& echo "Building apache ==============================" \& ./configure \e \& \-\-prefix=/usr/local/apache \e \& \-\-activate\-module=src/modules/perl/libperl.a \e \& \-\-enable\-module=ssl \e \& \-\-enable\-module=proxy \e \& \-\-enable\-module=so \e \& \-\-disable\-rule=EXPAT \& \& ^^^^^ .Ve .Sp keywords: segmentation fault, segfault seg fault .IP "Why do variables retain their values between requests?" 4 .IX Item "Why do variables retain their values between requests?" Unless scoped by \fImy()\fR or \fIlocal()\fR, perl variables in mod_perl are treated as globals, and values set may persist from one request to another. This can be seen in as simple a script as this: .Sp .Vb 4 \& \& $counter++; \& $Response\->Write("
Counter: $counter"); \& .Ve .Sp The value for \f(CW$counter\fR++ will remain between requests. Generally use of globals in this way is a \s-1BAD IDEA,\s0 and you can spare yourself many headaches if do \&\*(L"use strict\*(R" perl programming which forces you to explicitly declare globals like: .Sp .Vb 1 \& use vars qw($counter); .Ve .Sp You can make all your Apache::ASP scripts strict by default by setting: .Sp .Vb 1 \& PerlSetVar UseStrict 1 .Ve .IP "Apache errors on the PerlHandler or PerlModule directives ?" 4 .IX Item "Apache errors on the PerlHandler or PerlModule directives ?" You get an error message like this: .Sp .Vb 2 \& Invalid command \*(AqPerlModule\*(Aq, perhaps mis\-spelled or defined by a \& module not included in the server configuration. .Ve .Sp You do not have mod_perl correctly installed for Apache. The PerlHandler and PerlModule directives in Apache *.conf files are extensions enabled by mod_perl and will not work if mod_perl is not correctly installed. .Sp Common user errors are not doing a 'make install' for mod_perl, which installs the perl side of mod_perl, and not starting the right httpd after building it. The latter often occurs when you have an old apache server without mod_perl, and you have built a new one without copying over to its proper location. .Sp To get mod_perl, go to http://perl.apache.org .IP "Error: no request object (Apache=SCALAR(0x???????):)" 4 .IX Item "Error: no request object (Apache=SCALAR(0x???????):)" Your Apache + mod_perl build is not working properly, and is likely a RedHat Linux \s-1RPM DSO\s0 build. Make sure you statically build your Apache + mod_perl httpd, recompiled fresh from the sources. .IP "I am getting a tie or \s-1MLDBM /\s0 state error message, what do I do?" 4 .IX Item "I am getting a tie or MLDBM / state error message, what do I do?" Make sure the web server or you have write access to the eg directory, or to the directory specified as Global in the config you are using. Default for Global is the directory the script is in (e.g. '.'), but should be set to some directory not under the www server document root, for security reasons, on a production site. .Sp Usually a .Sp .Vb 1 \& chmod \-R \-0777 eg .Ve .Sp will take care of the write access issue for initial testing purposes. .Sp Failing write access being the problem, try upgrading your version of Data::Dumper and \s-1MLDBM,\s0 which are the modules used to write the state files. .SS "Sessions" .IX Subsection "Sessions" .ie n .IP "How can I use $Session to store complex data structures." 4 .el .IP "How can I use \f(CW$Session\fR to store complex data structures." 4 .IX Item "How can I use $Session to store complex data structures." Very carefully. Please read the \f(CW$Session\fR documentation in the \s-1OBJECTS\s0 section. You can store very complex objects in \f(CW$Session\fR, but you have to understand the limits, and the syntax that must be used to make this happen. .Sp In particular, stay away from statements that that have more than one level of indirection on the left side of an assignment like: .Sp .Vb 1 \& BAD: $Session\->{complex}{object} = $data; .Ve .IP "How can I keep search engine spiders from killing the session manager?" 4 .IX Item "How can I keep search engine spiders from killing the session manager?" If you want to disallow session creation for certain non web browser user agents, like search engine spiders, you can use a mod_perl PerlInitHandler like this to set configuration variables at runtime: .Sp .Vb 2 \& # put the following code into httpd.conf and stop/start apache server \& PerlInitHandler My::InitHandler \& \& \& \& package My::InitHandler; \& use Apache; \& \& sub handler { \& my $r = shift; # get the Apache request object \& \& # if not a Mozilla User Agent, then disable sessions explicitly \& unless($r\->headers_in(\*(AqUser\-Agent\*(Aq) =~ /^Mozilla/) { \& $r\->dir_config(\*(AqAllowSessionState\*(Aq, \*(AqOff\*(Aq); \& } \& \& return 200; # return OK mod_perl status code \& } \& \& 1; \& \& .Ve .Sp This will configure your environment before Apache::ASP executes and sees the configuration settings. You can use the mod_perl \&\s-1API\s0 in this way to configure Apache::ASP at runtime. .Sp Note that the Session Manager is very robust on its own, and denial of service attacks of the types that spiders and other web bots normally execute are not likely to affect the Session Manager significantly. .ie n .IP "How can I use $Session to store a $dbh database handle ?" 4 .el .IP "How can I use \f(CW$Session\fR to store a \f(CW$dbh\fR database handle ?" 4 .IX Item "How can I use $Session to store a $dbh database handle ?" You cannot use \f(CW$Session\fR to store a \f(CW$dbh\fR handle. This can be awkward for those coming from the \s-1IIS/NT\s0 world, where you could store just about anything in \f(CW$Session\fR, but this boils down to a difference between threads vs. processes. .Sp Database handles often have per process file handles open, which cannot be shared between requests, so though you have stored the \f(CW$dbh\fR data in \f(CW$Session\fR, all the other initializations are not relevant in another httpd process. .Sp All is not lost! Apache::DBI can be used to cache database connections on a per process basis, and will work for most cases. .SS "Development" .IX Subsection "Development" .IP "VBScript or JScript supported?" 4 .IX Item "VBScript or JScript supported?" Only Perl scripting is supported with this module. .IP "How is database connectivity handled?" 4 .IX Item "How is database connectivity handled?" Database connectivity is handled through perl's \s-1DBI & DBD\s0 interfaces. In the \s-1UNIX\s0 world, it seems most databases have cross platform support in perl. You can find the book on \s-1DBI\s0 programming at http://www.oreilly.com/catalog/perldbi/ .Sp \&\s-1DBD::ODBC\s0 is often your ticket on Win32. On \s-1UNIX,\s0 commercial vendors like OpenLink Software (http://www.openlinksw.com/) provide the nuts and bolts for \s-1ODBC.\s0 .Sp Database connections can be cached per process with Apache::DBI. .IP "What is the best way to debug an \s-1ASP\s0 application ?" 4 .IX Item "What is the best way to debug an ASP application ?" There are lots of perl-ish tricks to make your life developing and debugging an \s-1ASP\s0 application easier. For starters, you will find some helpful hints by reading the \&\f(CW$Response\fR\->\fIDebug()\fR \s-1API\s0 extension, and the Debug configuration directive. .IP "How are file uploads handled?" 4 .IX Item "How are file uploads handled?" Please see the \s-1CGI\s0 section. File uploads are implemented through \s-1CGI\s0.pm which is loaded at runtime only for this purpose. This is the only time that \s-1CGI\s0.pm will be loaded by Apache::ASP, which implements all other cgi-ish functionality natively. The rationale for not implementing file uploads natively is that the extra 100K in memory for \s-1CGI\s0.pm shouldn't be a big deal if you are working with bulky file uploads. .IP "How do I access the \s-1ASP\s0 Objects in general?" 4 .IX Item "How do I access the ASP Objects in general?" All the \s-1ASP\s0 objects can be referenced through the main package with the following notation: .Sp .Vb 1 \& $main::Response\->Write("html output"); .Ve .Sp This notation can be used from anywhere in perl, including routines registered with \f(CW$Server\fR\->\fIRegisterCleanup()\fR. .Sp You use the normal notation in your scripts, includes, and global.asa: .Sp .Vb 1 \& $Response\->Write("html output"); .Ve .IP "Can I \fIprint()\fR in \s-1ASP\s0?" 4 .IX Item "Can I print() in ASP?" Yes. You can \fIprint()\fR from anywhere in an \s-1ASP\s0 script as it aliases to the \f(CW$Response\fR\->\fIWrite()\fR method. Using \fIprint()\fR is portable with PerlScript when using Win32::ASP in that environment. .IP "Do I have access to ActiveX objects?" 4 .IX Item "Do I have access to ActiveX objects?" Only under Win32 will developers have access to ActiveX objects through the perl Win32::OLE interface. This will remain true until there are free \s-1COM\s0 ports to the \s-1UNIX\s0 world. At this time, there is no ActiveX for the \s-1UNIX\s0 world. .SS "Support and Production" .IX Subsection "Support and Production" .IP "How do I get things I want done?!" 4 .IX Item "How do I get things I want done?!" If you find a problem with the module, or would like a feature added, please mail support, as listed in the \s-1SUPPORT\s0 section, and your needs will be promptly and seriously considered, then implemented. .IP "What is the state of Apache::ASP? Can I publish a web site on it?" 4 .IX Item "What is the state of Apache::ASP? Can I publish a web site on it?" Apache::ASP has been production ready since v.02. Work being done on the module is on a per need basis, with the goal being to eventually have the \s-1ASP API\s0 completed, with full portability to ActiveState PerlScript and \s-1MKS\s0 PScript. If you can suggest any changes to facilitate these goals, your comments are welcome. .SH "TUNING" .IX Header "TUNING" A little tuning can go a long way, and can make the difference between a web site that gets by, and a site that screams with speed. With Apache::ASP, you can easily take a poorly tuned site running at 10 hits/second to 50+ hits/second just with the right configuration. .PP Documented below are some simple things you can do to make the most of your site. .SS "Online Resources" .IX Subsection "Online Resources" For more tips & tricks on tuning Apache and mod_perl, please see the tuning documents at: .PP .Vb 2 \& Stas Bekman\*(Aqs mod_perl guide \& http://perl.apache.org/guide/ .Ve .PP Written in late 1999 this article provides an early look at how to tune your Apache::ASP web site. It has since been updated to remain current with Apache::ASP v2.29+ .PP .Vb 2 \& Apache::ASP Site Tuning \& http://www.apache\-asp.org/articles/perlmonth3_tune.html .Ve .SS "Tuning & Benchmarking" .IX Subsection "Tuning & Benchmarking" When performance tuning, it is important to have a tool to measure the impact of your tuning change by change. The program ab, or Apache Bench, provides this functionality well, and is freely included in the apache distribution. .PP Because performance tuning can be a neverending affair, it is a good idea to establish a threshold where performance is \*(L"good enough\*(R", that once reached, tuning stops. .ie n .SS "$Application & $Session State" .el .SS "\f(CW$Application\fP & \f(CW$Session\fP State" .IX Subsection "$Application & $Session State" Use NoState 1 setting if you don't need the \f(CW$Application\fR or \f(CW$Session\fR objects. State objects such as these tie to files on disk and will incur a performance penalty. .PP If you need the state objects \f(CW$Application\fR and \f(CW$Session\fR, and if running an \s-1OS\s0 that caches files in memory, set your \*(L"StateDir\*(R" directory to a cached file system. On WinNT, all files may be cached, and you have no control of this. On Solaris, /tmp is a \s-1RAM\s0 disk and would be a good place to set the \*(L"StateDir\*(R" config setting to. When cached file systems are used there is little performance penalty for using state files. Linux tends to do a good job caching its file systems, so pick a StateDir for ease of system administration. .PP On Win32 systems, where mod_perl requests are serialized, you can freely use SessionSerialize to make your \f(CW$Session\fR requests faster, and you can achieve similar performance benefits for \&\f(CW$Application\fR if you call \f(CW$Application\fR\->\fILock()\fR in your global.asa's Script_OnStart. .SS "Low MaxClients" .IX Subsection "Low MaxClients" Set your MaxClients low, such that if you have that many httpd servers running, which will happen on busy site, your system will not start swapping to disk because of excessive \s-1RAM\s0 usage. Typical settings are less than 100 even with 1 gig \s-1RAM\s0! To handle more client connections, look into a dual server, mod_proxy front end. .SS "High MaxRequestsPerChild" .IX Subsection "High MaxRequestsPerChild" Set your max requests per child thread or process (in httpd.conf) high, so that \s-1ASP\s0 scripts have a better chance being cached, which happens after they are first compiled. You will also avoid the process fork penalty on \&\s-1UNIX\s0 systems. Somewhere between 50 \- 500 is probably pretty good. You do not want to set this too high though or you will risk having your web processes use too much \s-1RAM.\s0 One may use Apache::SizeLimit or Apache::GTopLimit to optimally tune MaxRequestsPerChild at runtime. .SS "Precompile Modules" .IX Subsection "Precompile Modules" For those modules that your Apache::ASP application uses, make sure that they are loaded in your sites startup.pl file, or loaded with PerlModule in your httpd.conf, so that your modules are compiled pre-fork in the parent httpd. .SS "Precompile Scripts" .IX Subsection "Precompile Scripts" Precompile your scripts by using the Apache::ASP\->\fILoader()\fR routine documented below. This will at least save the first user hitting a script from suffering compile time lag. On \s-1UNIX,\s0 precompiling scripts upon server startup allows this code to be shared with forked child www servers, so you reduce overall memory usage, and use less \s-1CPU\s0 compiling scripts for each separate www server process. These savings could be significant. On a \s-1PII300\s0 Solaris x86, it takes a couple seconds to compile 28 scripts upon server startup, with an average of 50K \s-1RAM\s0 per compiled script, and this savings is passed on to the \s-1ALL\s0 child httpd servers, so total savings would be 50Kx28x20(MaxClients)=28M! .PP Apache::ASP\->\fILoader()\fR can be called to precompile scripts and even entire \s-1ASP\s0 applications at server startup. Note also that in modperl, you can precompile modules with the PerlModule config directive, which is highly recommended. .PP .Vb 1 \& Apache::ASP\->Loader($path, $pattern, %config) .Ve .PP This routine takes a file or directory as its first argument. If a file, that file will be compiled. If a directory, that directory will be recursed, and all files in it whose file name matches \f(CW$pattern\fR will be compiled. \f(CW$pattern\fR defaults to .*, which says that all scripts in a directory will be compiled by default. .PP The \f(CW%config\fR args, are the config options that you may want set that affect compilation. These options include: Debug, Global, GlobalPackage, DynamicIncludes, IncludesDir, InodeNames, PodComments, StatINC, StatINCMatch, UseStrict, XMLSubsPerlArgs, XMLSubsMatch, and XMLSubsStrict. If your scripts are later run with different config options, your scripts may have to be recompiled. .PP Here is an example of use in a *.conf file: .PP .Vb 5 \& \& Apache::ASP\->Loader( \& \*(Aq/usr/local/proj/site\*(Aq, "(asp|htm)\e$", \& \*(AqGlobal\*(Aq => \*(Aq/proj/perllib\*(Aq, \& \*(AqDebug\*(Aq => \-3, # see system output when starting apache \& \& # OPTIONAL configs if you use them in your apache configuration \& # these settings affect how the scripts are compiled and loaded \& \*(AqGlobalPackage\*(Aq => \*(AqSomePackageName\*(Aq, \& \*(AqDynamicIncludes\*(Aq => 1, \& \*(AqStatINC\*(Aq => 1, \& \*(AqStatINCMatch\*(Aq => \*(AqMy\*(Aq, \& \*(AqUseStrict\*(Aq => 1, \& \*(AqXMLSubsMatch\*(Aq => \*(Aqmy:\ew+\*(Aq, \& \*(AqXMLSubsStrict\*(Aq => 0 || 1, \& ); \& .Ve .PP This config section tells the server to compile all scripts in c:/proj/site that end in asp or htm, and print debugging output so you can see it work. It also sets the Global directory to be /proj/perllib, which needs to be the same as your real config since scripts are cached uniquely by their Global directory. You will probably want to use this on a production server, unless you cannot afford the extra startup time. .PP To see precompiling in action, set Debug to 1 for the \fILoader()\fR and for your application in general and watch your error_log for messages indicating scripts being cached. .SS "No .htaccess or StatINC" .IX Subsection "No .htaccess or StatINC" Don't use .htaccess files or the StatINC setting in a production system as there are many more files touched per request using these features. I've seen performance slow down by half because of using these. For eliminating the .htaccess file, move settings into *.conf Apache files. .PP Instead of StatINC, try using the StatINCMatch config, which will check a small subset of perl libraries for changes. This config is fine for a production environment, and if used well might only incur a 10\-20% performance penalty, depending on the number of modules your system loads in all, as each module needs to be checked for changes on a per request basis. .SS "Turn off Debugging" .IX Subsection "Turn off Debugging" Turn off system debugging by setting Debug to 0\-3. Having the system debug config option on slows things down immensely, but can be useful when troubleshooting your application. System level debugging is settings \-3 through \-1, where user level debugging is 1 to 3. User level debugging is much more light weight depending on how many \f(CW$Reponse\fR\->\fIDebug()\fR statements you use in your program, and you may want to leave it on. .SS "Memory Sparing, NoCache" .IX Subsection "Memory Sparing, NoCache" If you have a lot (1000's+) of scripts, and limited memory, set NoCache to 1, so that compiled scripts are not cached in memory. You lose about 10\-15% in speed for small scripts, but save at least 10K \s-1RAM\s0 per cached script. These numbers are very rough and will largely depend on the size of your scripts and includes. .SS "Resource Limits" .IX Subsection "Resource Limits" Make sure your web processes do not use too many resources like \s-1CPU\s0 or \s-1RAM\s0 with the handy Apache::Resource module. Such a config might look like: .PP .Vb 3 \& PerlModule Apache::Resource \& PerlSetEnv PERL_RLIMIT_CPU 1000 \& PerlSetEnv PERL_RLIMIT_DATA 60:60 .Ve .PP If ever a web process should begin to take more than 60M ram or use more than 1000 \s-1CPU\s0 seconds, it will be killed by the \s-1OS\s0 this way. You only want to use this configuration to protect against runaway processes and web program errors, not for terminating a normally functioning system, so set these limits \s-1HIGH\s0! .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIperl\fR\|(1), \fImod_perl\fR\|(3), \fIApache\fR\|(3), \s-1\fIMLDBM\s0\fR\|(3), \fIHTTP::Date\fR\|(3), \s-1\fICGI\s0\fR\|(3), \&\fIWin32::OLE\fR\|(3) .SH "NOTES" .IX Header "NOTES" Many thanks to those who helped me make this module a reality. With Apache + \s-1ASP +\s0 Perl, web development could not be better! .PP Special thanks go to my father Kevin & wife Lina for their love and support through it all, and without whom none of it would have been possible. .PP Other honorable mentions include: .PP .Vb 1 \& !! Gregory Youngblood, Thanos Chatziathanassiou, & Tsirkin Evgeny for keeping the flame alive! \& \& :) Doug MacEachern, for moral support and of course mod_perl \& :) Helmut Zeilinger, Skylos, John Drago, and Warren Young for their help in the community \& :) Randy Kobes, for the win32 binaries, and for always being the epitome of helpfulness \& :) Francesco Pasqualini, for bug fixes with stand alone CGI mode on Win32 \& :) Szymon Juraszczyk, for better ContentType handling for settings like Clean. \& :) Oleg Kobyakovskiy, for identifying the double Session_OnEnd cleanup bug. \& :) Peter Galbavy, for reporting numerous bugs and maintaining the OpenBSD port. \& :) Richard Curtis, for reporting and working through interesting module \& loading issues under mod_perl2 & apache2, and pushing on the file upload API. \& :) Rune Henssel, for catching a major bug shortly after 2.47 release, \& and going to great lengths to get me reproducing the bug quickly. \& :) Broc, for keeping things filter aware, which broke in 2.45, \& & much help on the list. \& :) Manabu Higashida, for fixes to work under perl 5.8.0 \& :) Slaven Rezic, for suggestions on smoother CPAN installation \& :) Mitsunobu Ozato, for working on a japanese translation of the site & docs. \& :) Eamon Daly for persistence in resolving a MailErrors bug. \& :) Gert, for help on the mailing list, and pushing the limits of use on Win32 \& in addition to XSLT. \& :) Maurice Aubrey, for one of the early fixes to the long file name problem. \& :) Tom Lancaster, for pushing the $Server\->Mail API and general API discussion. \& :) Ross Thomas, for pushing into areas so far unexplored. \& :) Harald Kreuzer, for bug discovery & subsequent testing in the 2.25 era. \& :) Michael Buschauer for his extreme work with XSLT. \& :) Dariusz Pietrzak for a nice parser optimization. \& :) Ime Smits, for his inode patch facilitating cross site code reuse, and \& some nice performance enhancements adding another 1\-2% speed. \& :) Michael Davis, for easier CPAN installation. \& :) Brian Wheeler, for keeping up with the Apache::Filter times, \& and pulling off filtering ASP\->AxKit. \& :) Ged Haywood, for his great help on the list & professionally. \& :) Vee McMillen, for OSS patience & understanding. \& :) Craig Samuel, at LRN, for his faith in open source for his LCEC. \& :) Geert Josten, for his wonderful work on XML::XSLT \& :) Gerald Richter, for his Embperl, collaboration and competition! \& :) Stas Bekman, for his beloved guide, and keeping us all worldly. \& :) Matt Sergeant, again, for ever the excellent XML critique. \& :) Remi Fasol + Serge Sozonoff who inspired cookieless sessions. \& :) Matt Arnold, for the excellent graphics ! \& :) Adi, who thought to have full admin control over sessions \& :) Dmitry Beransky, for sharable web application includes, ASP on the big. \& :) Russell Weiss again, for finding the internal session garbage collection \& behaving badly with DB_File sensitive i/o flushing requirements. \& :) Tony Merc Mobily, inspiring tweaks to compile scripts 10 times faster \& :) Paul Linder, who is Mr. Clean... not just the code, its faster too ! \& Boy was that just the beginning. Work with him later facilitated better \& session management and XMLSubsMatch custom tag technology. \& :) Russell Weiss, for being every so "strict" about his code. \& :) Bill McKinnon, who understands the finer points of running a web site. \& :) Richard Rossi, for his need for speed & boldly testing dynamic includes. \& :) Greg Stark, for endless enthusiasm, pushing the module to its limits. \& :) Marc Spencer, who brainstormed dynamic includes. \& :) Doug Silver, for finding most of the bugs. \& :) Darren Gibbons, the biggest cookie\-monster I have ever known. \& :) Ken Williams, for great teamwork bringing full SSI to the table \& :) Matt Sergeant, for his great tutorial on PerlScript and love of ASP \& :) Jeff Groves, who put a STOP to user stop button woes \& :) Alan Sparks, for knowing when size is more important than speed \& :) Lincoln Stein, for his blessed CGI.pm module \& :) Michael Rothwell, for his love of Session hacking \& :) Francesco Pasqualini, for bringing ASP to CGI \& :) Bryan Murphy, for being a PerlScript wiz \& :) Lupe Christoph, for his immaculate and stubborn testing skills \& :) Ryan Whelan, for boldly testing on Unix in the early infancy of ASP .Ve .SH "SUPPORT" .IX Header "SUPPORT" .SS "\s-1COMMUNITY\s0" .IX Subsection "COMMUNITY" .IP "Mailing List Archives" 4 .IX Item "Mailing List Archives" Try the Apache::ASP mailing list archive first when working through an issue as others may have had the same question as you, then try the mod_perl list archives since often problems working with Apache::ASP are really mod_perl ones. .Sp The Apache::ASP mailing list archives are located at: .Sp .Vb 2 \& http://groups.yahoo.com/group/apache\-asp/ \& http://www.mail\-archive.com/asp%40perl.apache.org/ .Ve .Sp The mod_perl mailing list archives are located at: .Sp .Vb 1 \& http://mail\-archives.apache.org/mod_mbox/perl\-modperl/ .Ve .IP "Mailing List" 4 .IX Item "Mailing List" Please subscribe to the Apache::ASP mailing list by sending an email to asp\-subscribe[at]perl.apache.org and send your questions or comments to the list after your subscription is confirmed. .Sp To unsubscribe from the Apache::ASP mailing list, just send an email to asp\-unsubscribe[at]perl.apache.org .Sp If you think this is a mod_perl specific issue, you can send your question to modperl[at]apache.org .IP "Donations" 4 .IX Item "Donations" Apache::ASP is freely distributed under the terms of the Perl artistic license ( see the \s-1LICENSE\s0 section ). If you would like to donate time to the project, please get involved on the Apache::ASP Mailing List, and submit ideas, bug fixes and patches for the core system, and perhaps most importantly to simply support others in learning the ins and outs of the software. .SS "\s-1COMMERCIAL\s0" .IX Subsection "COMMERCIAL" If you would like commercial support for Apache::ASP, please check out any of the following listed companies. Note that this is not an endorsement, and if you would like your company listed here, please email asp[at]perl.apache.org with your information. .IP "AlterCom" 4 .IX Item "AlterCom" We use, host and support mod_perl. We would love to be able to help anyone with their mod_perl Apache::ASP needs. Our mod_perl hosting is \f(CW$24\fR.95 mo. .Sp .Vb 1 \& http://altercom.com/home.html .Ve .IP "The Cyberchute Connection" 4 .IX Item "The Cyberchute Connection" Our hosting services support Apache:ASP along with Mod_Perl, \s-1PHP\s0 and MySQL. .Sp .Vb 1 \& http://www.Cyberchute.com .Ve .IP "OmniTI" 4 .IX Item "OmniTI" OmniTI supports Apache and mod_perl (including Apache::ASP) and offers competitive pricing for both hourly and project-based jobs. OmniTI has extensive experience managing and maintaining both large and small projects. Our services range from short-term consulting to project-based development, and include ongoing maintenance and hosting. .Sp .Vb 1 \& http://www.omniti.com .Ve .IP "\s-1TUX IT AG\s0" 4 .IX Item "TUX IT AG" Main business is implementing and maintaining infrastructure for big websites and portals, as well as developing web applications for our customers (Apache, Apache::ASP, \s-1PHP,\s0 Perl, MySQL, etc.) .Sp The prices for our service are about 900 \s-1EUR\s0 per day which is negotiable (for longer projects, etc.). .Sp .Vb 1 \& http://www.tuxit.de .Ve .SH "SITES USING" .IX Header "SITES USING" What follows is a list of public sites that are using Apache::ASP. If you use the software for your site, and would like to show your support of the software by being listed, please send your link to asp[at]perl.apache.org .PP For a list of testimonials of those using Apache::ASP, please see the \s-1TESTIMONIALS\s0 section. .PP .Vb 2 \& PERSONiO Match \& http://www.personio.com/home.asp \& \& gutscheinwurst.de \- a German voucher community \& http://www.gutscheinwurst.de \& \& SalesJobs.com \& http://www.salesjobs.com \& \& hanschur.de \& http://www.hanschur.de \& \& Webtist \& http://www.webtist.de \& \& FreeLotto \& http://www.freelotto.com \& \& Hungarian TOP1000 \& http://www.hungariantop1000.com \& \& Hungarian Registry \& http://www.hunreg.com \& \& Kepeslap.com \& http://www.kepeslap.com \& \& yourpostcardsite.com \& http://www.yourpostcardsite.com \& \& WebTime \& http://webtime\-project.net \& \& AlterCom, Advanced Web Hosting \& http://altercom.com/ \& \& AmericanGamers.com \& http://www.AmericanGamers.com/ \& \& ESSTECwebservices \& http://www.esstec.be/ \& \& Alumni.NET \& http://www.alumni.net \& \& Anime Wallpapers dot com \& http://www.animewallpapers.com/ \& \& Cine.gr \& http://www.cine.gr \& \& Condo\-Mart Web Service \& http://www.condo\-mart.com \& \& Discountclick.com \& http://www.discountclick.com/ \& \& HCST \& http://www.hcst.net \& \& International Telecommunication Union \& http://www.itu.int \& \& Integra \& http://www.integra.ru/ \& \& Money FM \& http://www.moneyfm.gr \& \& Motorsport.com \& http://www.motorsport.com \& \& MLS of Greater Cincinnati \& http://www.cincymls.com \& \& NodeWorks Link Checker \& http://www.nodeworks.com \& \& OnTheWeb Services \& http://www.ontheweb.nu \& \& Prices for Antiques \& http://www.p4a.com \& \& redhat.com | support \& http://www.redhat.com/apps/support/ \& \& Spotlight \& http://www.spotlight.com.au \& \& USCD Electrical & Computer Engineering \& http://ece\-local.ucsd.edu .Ve .SH "TESTIMONIALS" .IX Header "TESTIMONIALS" Here are testimonials from those using Apache::ASP. If you use this software and would like to show your support please send your testimonial to Apache::ASP mailing list at asp[at]perl.apache.org and indicate that we can post it to the web site. .PP For a list of sites using Apache::ASP, please see the \s-1SITES USING\s0 section. .IP "Red Hat" 4 .IX Item "Red Hat" We're using Apache::ASP on www.redhat.com. We find Apache::ASP very easy to use, and it's quick for new developers to get up to speed with it, given that many people have already been exposed to the \s-1ASP\s0 object model that Apache::ASP is based on. .Sp The documentation is comprehensive and easy to understand, and the community and maintainer have been very helpful whenever we've had questions. .Sp .Vb 1 \& \-\- Tom Lancaster, Red Hat .Ve .IP "Anime Wallpaper at Anime Cubed" 4 .IX Item "Anime Wallpaper at Anime Cubed" Your suite has got our old \s-1CGI\s0 implementation beat, hands down. Our site is divided into two main areas, each run by a separate developer, and the Apache::ASP section runs head and shoulders above the other side. Anyone who is still using anything but your product to implement their webpages seriously needs to take a look at how versatile and powerful Apache::ASP is. Thanks again for such great work! .Sp .Vb 1 \& \-\- Al from \*(AqAnime Wallpaper at Anime Cubed\*(Aq, http://www.animecubed.com/wallpapers/ .Ve .IP "gutscheinwurst.de" 4 .IX Item "gutscheinwurst.de" I am the web master of http://www.gutscheinwurst.de , a German voucher community. We use Apache::Asp to run our backend & administration servers for the system. We started using Apache::ASP to see whether it is a valid alternative to \s-1IIS\s0 legacy systems. So far all expectations in regard of performance, ease of development and integration have been fulfilled or exceeded. Thank's for such a great product :) .Sp .Vb 1 \& \-\- Johnannes Leimbach .Ve .IP "D. L. Fox" 4 .IX Item "D. L. Fox" I had programmed in Perl for some time ... but, since I also knew \s-1VB, I\s0 had switched to \s-1VB\s0 in IIS-ASP for web stuff because of its ease of use in embedding code with \s-1HTML ...\s0 When I discovered Apache-ASP, it was like a dream come true. I would much rather code in Perl than any other language. Thanks for such a fine product! .IP "\s-1HOSTING 321, LLC.\s0" 4 .IX Item "HOSTING 321, LLC." After discontinuing Windows-based hosting due to the high cost of software, our clients are thrilled with Apache::ASP and they swear \s-1ASP\s0 it's faster than before. Installation was a snap on our 25\-server web farm with a small shell script and everything is running perfectly! The documentation is very comprehensive and everyone has been very helpful during this migration. .Sp Thank you! .Sp .Vb 1 \& \-\- Richard Ward, HOSTING 321, LLC. .Ve .IP "Concept Online Ltd." 4 .IX Item "Concept Online Ltd." I would like to say that your \s-1ASP\s0 module rocks :\-) We have practically stopped developing in anything else about half a year ago, and are now using Apache::ASP extensively. I just love Perl, and wherever we are not \*(L"forced\*(R" to use \s-1JSP,\s0 we chose \s-1ASP.\s0 It is fast, reliable, versatile, documented in a way that is the best for professionals \- so thank you for writing and maintaining it! .Sp .Vb 1 \& \-\- Csongor Fagyal, Concept Online Ltd. .Ve .IP "WebTime" 4 .IX Item "WebTime" As we have seen with WebTime, Apache::ASP is not only good for the development of website, but also for the development of webtools. Since I first discoverd it, I made it a must-have in my society by taking traditional \s-1PHP\s0 users to the world of perl afficionados. .Sp Having the possibility to use Apache::ASP with mod_perl or mod_cgi make it constraintless to use because of \s-1CGI\s0's universality and perl's portability. .Sp .Vb 1 \& \-\- Grégoire Lejeune .Ve .IP "David Kulp" 4 .IX Item "David Kulp" First, I just want to say that I am very very impressed with Apache::ASP. I just want to gush with praise after looking at many other implementations of perl embedded code and being very underwhelmed. This is so damn slick and clean. Kudos! ... .Sp \&... I'm very pleased how quickly I've been able to mock up the application. I've been writing Perl \s-1CGI\s0 off and on since 1993(!) and I can tell you that Apache::ASP is a pleasure. (Last year I tried Zope and just about threw my computer out the window.) .Sp .Vb 1 \& \-\- David Kulp .Ve .IP "\s-1MFM\s0 Commmunication Software, Inc." 4 .IX Item "MFM Commmunication Software, Inc." Working in a team environment where you have \s-1HTML\s0 coders and perl coders, Apache::ASP makes it easy for the \s-1HTML\s0 folks to change the look of the page without knowing perl. Using Apache::ASP (instead of another embedded perl solution) allows the \s-1HTML\s0 jockeys to use a variety of \s-1HTML\s0 tools that understand \s-1ASP,\s0 which reduces the amount of code they break when editing the \s-1HTML.\s0 Using Apache::ASP instead of M$ \s-1ASP\s0 allows us to use perl (far superior to VBScript) and Apache (far superior to \s-1IIS\s0). .Sp We've been very pleased with Apache::ASP and its support. .IP "Planet of Music" 4 .IX Item "Planet of Music" Apache::ASP has been a great tool. Just a little background.... the whole site had been in cgi flat files when I started here. I was looking for a technology that would allow me to write the objects and \s-1NEVER\s0 invoke \s-1CGI\s0.pm... I found it and hopefully I will be able to implement this every site I go to. .Sp When I got here there was a huge argument about needing a game engine and I believe this has been the key... Games are approx. 10 time faster than before. The games don't break anylonger. All in all a great tool for advancement. .Sp .Vb 1 \& \-\- JC Fant IV .Ve .IP "Cine.gr" 4 .IX Item "Cine.gr" \&...we ported our biggest yet \s-1ASP\s0 site from \s-1IIS\s0 (well, actually rewrote), Cine.gr and it is a killer site. In some cases, the whole thing got almost 25 (no typo) times faster... None of this would ever be possible without Apache::ASP (I do not ever want to write ``print \*(L"<\s-1HTML\s0>\en\*(R";'' again). .SH "RESOURCES" .IX Header "RESOURCES" Here are some important resources listed related to the use of Apache::ASP for publishing web applications. If you have any more to suggest, please email the Apache::ASP list at asp[at]perl.apache.org .SS "Articles" .IX Subsection "Articles" .Vb 2 \& Apache::ASP Introduction ( #1 in 3 part series ) \& http://www.apache\-asp.org/articles/perlmonth1_intro.html \& \& Apache::ASP Site Building ( #2 in 3 part series ) \& http://www.apache\-asp.org/articles/perlmonth2_build.html \& \& Apache::ASP Site Tuning ( #3 in 3 part series ) \& http://www.apache\-asp.org/articles/perlmonth3_tune.html \& \& Embedded Perl ( part of a series on Perl ) \& http://www.wdvl.com/Authoring/Languages/Perl/PerlfortheWeb/index15.html .Ve .SS "Books" .IX Subsection "Books" .Vb 2 \& mod_perl "Eagle" Book \& http://www.modperl.com \& \& mod_perl Developer\*(Aqs Cookbook \& http://www.modperlcookbook.org \& \& Programming the Perl DBI \& http://www.oreilly.com/catalog/perldbi/ .Ve .SS "Reference Cards" .IX Subsection "Reference Cards" .Vb 2 \& Apache & mod_perl Reference Cards \& http://www.refcards.com/ .Ve .SS "Web Sites" .IX Subsection "Web Sites" .Vb 2 \& mod_perl Apache web module \& http://perl.apache.org \& \& mod_perl 1.x Guide \& http://perl.apache.org/guide/ \& \& Perl Programming Language \& http://www.perl.com \& \& Apache Web Server \& http://www.apache.org .Ve .SH "TODO" .IX Header "TODO" There is no specific time frame in which these things will be implemented. Please let me know if any of these is of particular interest to you, and I will give it higher priority. .SS "\s-1WILL BE DONE\s0" .IX Subsection "WILL BE DONE" .Vb 3 \& + Database storage of $Session & $Application, so web clusters \& may scale better than the current NFS/CIFS StateDir implementation \& allows, maybe via Apache::Session. .Ve .SH "CHANGES" .IX Header "CHANGES" Apache::ASP has been in development since 1998, and was production ready since its .02 release. Releases are always used in a production setting before being made publically available. .PP In July 2000, the version numbers of releases went from .19 to 1.9 which is more relevant to software development outside the perl community. Where a .10 perl module usually means first production ready release, this would be the equivalent of a 1.0 release for other kinds of software. .PP .Vb 1 \& + = improvement \- = bug fix (d) = documentations .Ve .ie n .IP "$VERSION = 2.63; $DATE=""03/14/2018""" 4 .el .IP "\f(CW$VERSION\fR = 2.63; \f(CW$DATE\fR=``03/14/2018''" 4 .IX Item "$VERSION = 2.63; $DATE=03/14/2018" .Vb 2 \& + Added section \`\`raw\*(Aq\*(Aq to MailErrors.inc to debug POSTs without \& form fields \& \& \- MailErrorsHTML now uses monospaced fonts for errors. Easier on \& the eyes and more informative .Ve .ie n .IP "$VERSION = 2.62; $DATE=""08/16/2011""" 4 .el .IP "\f(CW$VERSION\fR = 2.62; \f(CW$DATE\fR=``08/16/2011''" 4 .IX Item "$VERSION = 2.62; $DATE=08/16/2011" .Vb 2 \& \- Fixed \*(Aqapplication/x\-www\-form\-urlencoded\*(Aq for AJAX POSTs post \& Firefox 3.x \& \& + First sourceforge.net hosted version \& \& + Incremented version number to actually match SVN branch tag .Ve .ie n .IP "$VERSION = 2.61; $DATE=""05/24/2008""" 4 .el .IP "\f(CW$VERSION\fR = 2.61; \f(CW$DATE\fR=``05/24/2008''" 4 .IX Item "$VERSION = 2.61; $DATE=05/24/2008" .Vb 1 \& \- updated for more recent mod_perl 2 environment to trigger correct loading of modules \& \& + loads modules in a backwards compatible way for older versions of mod_perl 1.99_07 to 1.99_09 \& \& + license changes from GPL to Perl Artistic License .Ve .ie n .IP "$VERSION = 2.59; $DATE=""05/23/2005""" 4 .el .IP "\f(CW$VERSION\fR = 2.59; \f(CW$DATE\fR=``05/23/2005''" 4 .IX Item "$VERSION = 2.59; $DATE=05/23/2005" .Vb 3 \& + added "use bytes" to Response object to calculate Content\-Length \& correctly for UTF8 data, which should require therefore at least \& perl version 5.6 installed \& \& + updated to work with latest mod_perl 2.0 module naming convention, \& thanks to Randy Kobes for patch \& \& + examples now exclude usage of Apache::Filter & Apache::SSI under mod_perl 2.0 .Ve .ie n .IP "$VERSION = 2.57; $DATE=""01/29/2004""" 4 .el .IP "\f(CW$VERSION\fR = 2.57; \f(CW$DATE\fR=``01/29/2004''" 4 .IX Item "$VERSION = 2.57; $DATE=01/29/2004" .Vb 1 \& \- $Server\->Transfer will update $0 correctly \& \& \- return 0 for mod_perl handler to work with latest mod_perl 2 release \& when we were returning 200 ( HTTP_OK ) before \& \& \- fixed bug in $Server\->URL when called like $Server\->URL($url) \& without parameters. Its not clear which perl versions this bug \& affected. .Ve .ie n .IP "$VERSION = 2.55; $DATE=""08/09/2003""" 4 .el .IP "\f(CW$VERSION\fR = 2.55; \f(CW$DATE\fR=``08/09/2003''" 4 .IX Item "$VERSION = 2.55; $DATE=08/09/2003" .Vb 2 \& \- Bug fixes for running on standalone CGI mode on Win32 submitted \& by Francesco Pasqualini \& \& + Added Apache::ASP::Request::BINMODE for binmode() being \& called on STDIN after STDIN is tied to $Request object \& \& + New RequestBinaryRead configuration created, may be turned off \& to prevent $Request object from reading POST data \& \& ++ mod_perl 2 optimizations, there was a large code impact on this, \& as much code was restructured to reduce the differences between \& mod_perl 1 and mod_perl 2, most importantly, Apache::compat is \& no longer used \& \& + preloaded CGI for file uploads in the mod_perl environment \& \& \- When XSLT config is set, $Response\->Redirect() should work now \& Thanks to Marcus Zoller for pointing problem out \& \& + Added CookieDomain setting, documented, and added test to cover \& it in t/cookies.t . Setting suggested by Uwe Riehm, who nicely \& submitted some code for this. .Ve .ie n .IP "$VERSION = 2.53; $DATE=""04/10/2003""" 4 .el .IP "\f(CW$VERSION\fR = 2.53; \f(CW$DATE\fR=``04/10/2003''" 4 .IX Item "$VERSION = 2.53; $DATE=04/10/2003" .Vb 3 \& + XMLSubs tags with "\-" in them will have "\-" replaced with "_" or underscore, so a \& tag like will be translated to &my::render_table() ... tags with \& \- in them are common in extended XML syntaxes, but perl subs cannot have \- in them only. \& \& + Clean setting now works on output when $Response\->{ContentType} begins with text/html; \& like "text/html; charset=iso\-8859\-2" ... before Clean would only work on output marked \& with ContentType text/html. Thanks to Szymon Juraszczyk for recommending fix. \& \& \-\-Fixed a bug which would cause Session_OnEnd to be called twice on sessions in a certain case, \& particularly when an old expired session gets reused by and web browser... this bug was \& a result of a incomplete session cleanup method in this case. Thanks to Oleg Kobyakovskiy \& for reporting this bug. Added test in t/session_events.t to cover this problem going forward. \& \& \- Compile errors from Apache::ASP\->Loader() were not being reported. They will \& be reported again now. Thanks to Thanos Chatziathanassiou for discovering and \& documenting this bug. Added test in t/load.t to cover this problem going forward. \& \& + use of chr(hex($1)) to decode URI encoded parameters instead of pack("c",hex($1)) \& faster & more correct, thanks to Nikolay Melekhin for pointing out this need. \& \& (d) Added old perlmonth.com articles to ./site/articles in distribution \& and linked to them from the docs RESOURCES section \& \& (d) Updated documentation for the $Application\->SessionCount API \& \& + Scripts with named subroutines, which is warned against in the style guide, \& will not be cached to help prevent my closure problems that often \& hurt new developers working in mod_perl environments. The downside \& is that these script will have a performance penalty having to be \& recompiled each invocation, but this will kill many closure caching \& bugs that are hard to detect. \& \& \- $Request\->FileUpload(\*(Aqupload_file\*(Aq, \*(AqBrowserFile\*(Aq) would return \& a glob before that would be the file name in scalar form. However \& this would be interpreted as a reference incorrectly. The fix \& is to make sure this is always a scalar by stringifying \& this data internally. Thanks to Richard Curtis for pointing \& out this bug. .Ve .ie n .IP "$VERSION = 2.51; $DATE=""02/10/2003""" 4 .el .IP "\f(CW$VERSION\fR = 2.51; \f(CW$DATE\fR=``02/10/2003''" 4 .IX Item "$VERSION = 2.51; $DATE=02/10/2003" .Vb 2 \& + added t/session_query_parse.t test to cover use of SessionQueryParse \& and $Server\->URL APIs \& \& \- Fixed duplicate "&" bug associated with using $Server\->URL \& and SessionQueryParse together \& \& + Patch to allow $Server\->URL() to be called multiple times on the same URL \& as in $Server\->URL($Server\->URL($url, \e%params), \e%more_params) \& \& (d) Added new testimonials & sites & created a separate testimonials page. \& \& \- SessionQueryParse will now add to & to the query strings \& embedded in the HTML, instead of & for proper HTML generation. \& Thanks to Peter Galbavy for pointing out and Thanos Chatziathanassiou \& for suggesting the fix. \& \& \- $Response\->{ContentType} set to text/html for developer error reporting, \& in case this was set to something else before the error occurred. \& Thanks to Philip Mak for reporting. \& \& \- Couple of minor bug fixes under PerlWarn use, thanks Peter Galbavy \& for reporting. \& \& + Added automatic load of "use Apache2" for compat with mod_perl2 \& request objects when Apache::ASP is loaded via "PerlModule Apache::ASP" \& Thanks to Richard Curtis for reporting bug & subsequent testing. \& \& \- When GlobalPackage config changes, but global.asa has not, global.asa \& will be recompiled anyway to update the GlobalPackage correctly. \& Changing GlobalPackage before would cause errors if global.asa was \& already compiled. \& \& ++ For ANY PerlSetVar type config, OFF/Off/off will be assumed \& to have value of 0 for that setting. Before, only a couple settings \& had this semantics, but they all do now for consistency. \& \& \- Fix for InodeNames config on OpenBSD, or any OS that might have \& a device # of 0 for the file being stat()\*(Aqd, thanks to Peter Galbavy \& for bug report. \& \& ++ Total XSLT speedups, 5\-10% on large XSLT, 10\-15% on small XSLT \& \& + bypass meta data check like expires for XSLT Cache() API use \& because XSLT transformations don\*(Aqt expire, saves hit to cache dbm \& for meta data \& \& + use of direct Apache::ASP::State methods like FETCH/STORE \& in Cache() layer so we don\*(Aqt have to go through slower tied interface. \& This will speed up XSLT & and include output caching mostly. \& \& + minor optimizations for speed & memory usage .Ve .ie n .IP "$VERSION = 2.49; $DATE=""11/10/2002""" 4 .el .IP "\f(CW$VERSION\fR = 2.49; \f(CW$DATE\fR=``11/10/2002''" 4 .IX Item "$VERSION = 2.49; $DATE=11/10/2002" .Vb 5 \& \-\- bug introduced in 2.47 cached script compilations for executing \& scripts ( not includes ) of the same name in different directories \& for the same Global/GlobalPackage config for an application. \& Fix was to remove optimization that caused problem, and \& created test case t/same_name.t to cover bug. .Ve .ie n .IP "$VERSION = 2.47; $DATE=""11/06/2002""" 4 .el .IP "\f(CW$VERSION\fR = 2.47; \f(CW$DATE\fR=``11/06/2002''" 4 .IX Item "$VERSION = 2.47; $DATE=11/06/2002" .Vb 10 \& ++ Runtime speed enhancements for 15\-20% improvement including: \& + INTERNAL API ReadFile() now returns scalar ref as memory optimization \& + cache InodeNames config setting in ASP object now for common lookups \& + removed CompileChecksum() INTERNAL API, since it was an unnecessary \& method decomposition along a common code path \& + removed IsChanged() INTERNAL API since compiling of scripts \& is now handled by CompileInclude() which does this functionality already \& + removed unnecessary decomp of IncludesChanged() INTERNAL API, which was along \& critical code path \& + do not call INTERNAL SearchDirs() API when compiling base script \& since we have already validated its path earlier \& + Use stat(_) type shortcut for stat() & \-X calls where possible \& + Moved @INC initialization up to handler() & consolidated with $INCDir lib \& + removed useless Apache::ASP::Collection::DESTROY \& + removed useless Apache::ASP::Server::DESTROY \& + removed useless Apache::ASP::GlobalASA::DESTROY \& + removed useless Apache::ASP::Response::DESTROY \& \& \- Default path for $Response\->{Cookies} was from CookiePath \& config, but this was incorrect as CookiePath config is only \& for $Session cookie, so now path for $Response\->{Cookies} \& defaults to / \& \& \- Fixed bug where global.asa events would get undefined with \& StatINC and GlobalPackage set when the GlobalPackage library \& changed & get reloaded. \& \& (d) Documented long time config NoCache. \& \& \-\- Fixed use with Apache::Filter, capable as both source \& and destination filter. Added ./site/eg/filter.filter example \& to demonstrate these abilities. \& \& + Use $r\->err_headers_out\->add Apache::Table API for cookies \& now instead of $r\->cgi_header_out. Added t/cookies.t test to \& cover new code path as well as general $Response\->Cookies API. \& Also make cookies headers sorted by cookie and dictionary key \& while building headers for repeatable behavior, this latter was \& to facilitate testing. \& \& \- fixed $Server\->Mail error_log output when failing to connect \& to SMTP server. \& \& + added tests to cover UniquePackages & NoCache configs since this \& config logic was updated \& \& + made deprecated warnings for use of certain $Response\->Member \& calls more loudly write to error_log, so I can remove the AUTOLOAD \& for Response one day \& \& \- Probably fixed behavior in CgiHeaders, at least under perl 5.8.0, and \& added t/cgi_headers.t to cover this config. \& \& + removed $Apache::ASP::CompressGzip setting ability, used to possibly \& set CompressGzip in the module before, not documented anyway \& \& + removed $Apache::ASP::Filter setting ability to set Filter globally, \& not documented anyway \& \& + removed old work around for setting ServerStarting to 0 \& at runtime, which was bad for Apache::DBI on win32 a long \& time ago: \& \& $Apache::ServerStarting and $Apache::ServerStarting = 0; \& \& If this code is still needed in Apache::ASP\->handler() let \& me know. \& \& + check to make sure data in internal database is a HASH ref \& before using it for session garbage collection. This is to \& help prevent against internal database corruption in a \& network share that does not support flock() file locking. \& \& + For new XMLSubs ASP type <%= %> argument interpolation \& activated with XMLSubsPerlArgs 0, data references can now \& be passed in addition to SCALAR/string references, so one \& can pass an object reference like so: \& \& \& \& This will only work as long as the variable interpolation <%= %> \& are flushed against the containing " " or \*(Aq \*(Aq, or else the object \& reference will be stringified when it is concatenated with \& the rest of the data. \& \& Testing for this feature was added to ./t/xmlsubs_aspargs.t \& \& This feature is still experimental, and its interface may change. \& However it is slated for the 3.0 release as default method, \& so feedback is appreciated. \& \& + For new XMLSubs ASP type <%= %> argument interpolation \& activated with XMLSubsPerlArgs 0, <% %> will no longer work, \& just <%= %>, as in \& \& \& \& This feature is still experimental, and its interface may change. \& However it is slated for the 3.0 release as default method, \& so feedback is appreciated. .Ve .ie n .IP "$VERSION = 2.45; $DATE=""10/13/2002""" 4 .el .IP "\f(CW$VERSION\fR = 2.45; \f(CW$DATE\fR=``10/13/2002''" 4 .IX Item "$VERSION = 2.45; $DATE=10/13/2002" .Vb 4 \& ++New XMLSubsPerlArgs config, default 1, indicates how \& XMLSubs arguments have always been parsed. If set to 0, \& will enable new XMLSubs args that are more ASP like with \& <%= %> for dynamic interpolation, such as: \& \& \& \& Settings XMLSubsPerlArgs to 0 is experimental for now, but \& will become the default by Apache::ASP version 3.0 \& \& ++Optimization for static HTML/XML files that are served up \& via Apache::ASP so that they are not compiled into perl subroutines \& first. This makes especially native XSLT both faster & take \& less memory to serve, before XSL & XML files being transformed \& by XSLT would both be compiled as normal ASP script first, so \& now this will happen if they really are ASP scripts with embedded \& <% %> code blocks & XMLSubs being executed. \& \& +Consolidate some config data for Apache::ASP\->Loader to use \& globals in @Apache::ASP::CompileChecksumKeys to know which \& config data is important for precompiling ASP scripts. \& \& +Further streamlined code compilation. Now both base \& scripts and includes use the internal CompileInclude() API \& to generate code. \& \& \-Fixed runtime HTML error output when Debug is set to \-2/2, \& so that script correctly again gets rendered in final perl form. \& Added compile time error output to ./site/eg/syntax_error.asp \& when a special link is clicked for a quick visual test. \& \& \-Cleaned up some bad coding practices in ./site/eg/global.asa \& associated changes in other example files. Comment example \& global.asa some for the first time reader \& \& \-DemoASP.pm examples module needed "use strict" fix, thanks \& to Allan Vest for bug report \& \& \-\-$rv = $Response\->Include({ File => ..., Cache => 1}); \& now works to get the first returned value fetched from \& the cache. Before, because a list was always returned, \& $rv would have been equal to the number of items returned, \& even if the return value list has just one element. \& \& (d) added site/robots.txt file with just a comment for \& search engine indexing \& \& \-fixed ./site/eg/binary_write.htm to not use \& $Response\->{ContentLength} because it does not exist. \& Fixed it to use $Response\->AddHeader now instead .Ve .ie n .IP "$VERSION = 2.41; $DATE=""09/29/2002""" 4 .el .IP "\f(CW$VERSION\fR = 2.41; \f(CW$DATE\fR=``09/29/2002''" 4 .IX Item "$VERSION = 2.41; $DATE=09/29/2002" .Vb 3 \& \-Removed CVS Revision tag from Apache::ASP::Date, which \& was causing bad revision numbers in CPAN after CVS integration \& of Apache::ASP \& \& +removed cgi/asp link to ../asp\-perl from distribution. This \& link was for the deprecated asp script which is now asp\-perl .Ve .ie n .IP "$VERSION = 2.39; $DATE=""09/10/2002""" 4 .el .IP "\f(CW$VERSION\fR = 2.39; \f(CW$DATE\fR=``09/10/2002''" 4 .IX Item "$VERSION = 2.39; $DATE=09/10/2002" .Vb 4 \& \-Turn off $^W explicitly before reloading global.asa. Reloading \& global.asa when $^W is set will trigger subroutine redefinition \& warnings. Reloading global.asa should occur without any problems \& under normal usage of the system, thus this work around. \& \& This fix is important to UseStrict functionality because warnings \& automatically become thrown as die() errors with UseStrict enabled, \& so we have to disable normal soft warnings here. \& \& \-$Response\->Include() runtime errors now throw a die() that \& can be trapped. This was old functionality that has been restored. \& Other compile time errors should still trigger a hard error \& like script compilation, global.asa, or $Response\->Include() \& without an eval() \& \& +Some better error handling with Debug 3 or \-3 set, cleaned \& up developer errors messages somewhat. .Ve .ie n .IP "$VERSION = 2.37; $DATE=""07/03/2002""" 4 .el .IP "\f(CW$VERSION\fR = 2.37; \f(CW$DATE\fR=``07/03/2002''" 4 .IX Item "$VERSION = 2.37; $DATE=07/03/2002" .Vb 5 \& \-Fixed the testing directory structures for t/long_names.t \& so that tar software like Archive::Tar & Solaris tar that \& have problems with long file names will still be able \& to untar distribution successfully. Now t/long_names.t \& generates its testing directory structures at runtime. \& \& \-Fixes for "make test" to work under perl 5.8.0 RC2, \& courtesy of Manabu Higashida \& \& +SessionQueryForce setting created for disabling use of cookies \& for $Session session\-id passing, rather requiring use of SessionQuery* \& functionality for session\-id passing via URL query string. \& \& By default, even when SessionQuery* options are used, cookies will \& be used if available with SessionQuery* functionality acting only \& as a backup, so this makes it so that cookies will never be used. \& \& +Escape \*(Aq with HTMLEncode() to ' \& \& \-Trying to fix t/server_mail.t to work better for platforms \& that it should skip testing on. Updated t/server.t test case. \& \& +Remove exit() from Makefile.PL so CPAN.pm\*(Aqs automatic \& follow prereq mechanism works correctly. Thanks to Slaven Rezic \& for pointing this out. \& \& +Added Apache::compat loading in mod_perl environment for better \& mod_perl 2.0 support. .Ve .ie n .IP "$VERSION = 2.35; $DATE=""05/30/2002""" 4 .el .IP "\f(CW$VERSION\fR = 2.35; \f(CW$DATE\fR=``05/30/2002''" 4 .IX Item "$VERSION = 2.35; $DATE=05/30/2002" .Vb 5 \& +Destroy better $Server & $Response objects so that my \& closure references to these to not attempt to work in the future \& against invalid internal data. There was enough data left in these \& old objects to make debugging the my closure problem confusing, where \& it looked like the ASP object state became invalid. \& \& +Added system debug diagnostics to inspect StateManager group cleanup \& \& (d) Documentation update about flock() work around for \& Win95/Win98/WinMe systems, confirmed by Rex Arul \& \& (d) Documentation/site build bug found by Mitsunobu Ozato, \& where <% %> not being escaped correctly with $Server\->HTMLEncode(). \& New japanese documentation project started by him \& at http://sourceforge.jp/projects/apache\-asp\-jp/ \& \& \-InitPackageGlobals() called after new Apache::ASP object created so \& core system templates can be compiled even when there was a runtime \& compilation error of user templates. Bug fix needed pointed out by \& Eamon Daly .Ve .ie n .IP "$VERSION = 2.33; $DATE=""04/29/2002""" 4 .el .IP "\f(CW$VERSION\fR = 2.33; \f(CW$DATE\fR=``04/29/2002''" 4 .IX Item "$VERSION = 2.33; $DATE=04/29/2002" .Vb 3 \& \- fixed up t/server_mail.t test to skip if a sendmail server \& is not available on localhost. We only want the test to run \& if there is a server to test against. \& \& + removed cgi/asp script, just a symlink now to the ./asp\-perl script \& which in this way deprecates it. I had it hard linked, but the \& distribution did not untar very well on win32 platform. \& \& + Reordered the modules in Bundle::Apache::ASP for a cleaner install. \& \& \- Fixed bug where XMLSubs where removing tag \& when it was needed in XSLT mode. \& \& + $Server\->Mail({ CC => \*(Aq...\*(Aq, BCC => \*(Aq...\*(Aq }), now works to send \& CC & BCC headers/recipients. \& \& + Removed $Apache::ASP::Register definition which defined the current \& executing Apache::ASP object. Only one part of the application was \& using it, and this has been fixed. This would have been an unsafe \& use of globals for a threaded environment. \& \& + Decreased latency when doing Application_OnStart, used to sleep(1) \& for CleanupMaster sync, but this is not necessary for Application_OnStart \& scenario \& \& + Restructure code / core templates for MailErrorsTo funcationality. \& Wrote test mail_error.t to cover this. $ENV{REMOTE_USER} will now \& be displayed in the MailErrorsTo message when defined from 401 basic auth. \& \& + $Server\->RegisterCleanup should be thread safe now, as it no longer relies \& on access to @Apache::ASP::Cleanup for storing the CODE ref stack. \& \& + test t/inode_names.t for InodeNames and other file tests covering case \& of long file names. \& \& \- Fixed long file name sub identifier bug. Added test t/long_names.t. \& \& + CacheDir may now be set independently of StateDir. It used to default \& to StateDir if it was set. \& \& ++ Decomposition of modules like Apache::ASP::Session & Apache::ASP::Application \& out of ASP.pm file. This should make the source more developer friendly. \& \& This selective code compilation also speeds up CGI requests that do not \& need to load unneeded modules like Apache::ASP::Session, by about 50%, \& so where CGI mode ran at about 2.1 hits/sec before, now for \& light requests that do not load $Session & $Application, requests \& run at 3.4 hits/sec, this is on a dual PIII\-450 linux 2.4.x \& \& \- Caching like for XSLTCache now works in CGI mode. \& This was a bug that it did not before. \& \& + $Server\->File() API added, acts as a wrapper around \& Apache\->request\->filename Added test in t/server.t \& \& ++ *** EXPERIMENTAL / ALPHA FEATURE NOTE BEGIN *** \& \& New $PERLLIB/Apache/ASP/Share/ directory created to \& hold system & user contributed components, which will be found \& on the $Server\->MapInclude() path, which helps $Response\->Include \& search \*(Aq.\*(Aq,Global,IncludesDir, and now Apache::ASP::Share for \& includes to load at runtime. \& \& The syntax for loading a shared include is to prefix the file \& name with Share:: as in: \& \& $Response\->TrapInclude(\*(AqShare::CORE/MailError.inc\*(Aq); \& \& New test to cover this at t/share.t \& \& This feature is experimental. The naming convention may change \& and the feature may disappear altogether, so only use if you \& are interesting in experimenting with this feature & will \& provide feedback about how it works. \& \& *** EXPERIMENTAL / ALPHA FEATURE NOTE END *** \& \& + asp\-perl script now uses ./asp.conf instead of ./asp.config \& for runtime configuration via %Config defined there. Update docs \& for running in standalone CGI mode \& \& + Make use of MANFEST.SKIP to not publish the dev/* files anymore. \& \& \- Script_OnEnd guaranteed to run after $Response\->End, but \& it will not run if there was an error earlier in the request. \& \& + lots of new test cases covering behaviour of $Response\->End \& and $Response\->Redirect under various conditions like XMLSubs \& and SoftRedirect and global.asa Script_OnStart \& \& + asp\-perl will be installed into the bin executables when \& Apache::ASP is installed. asp\-perl is the command line version \& of Apache::ASP that can also be used to run script in CGI mode. \& Test case covering asp\-perl functionality. \& \& + asp CGI/command line script now called asp\-perl. I picked this \& name because Apache::ASP often has the name asp\-perl in distributions \& of the module. \& \& + Apache::ASP::CGI::Test class now subclass of Apache::ASP::CGI. To facilitate \& this Apache::ASP::CGI::init() now called OO like Apache::ASP::CGI\->init() \& Fixed up places where the old style was called. New Test class allows \& a dummy Apache request object to be built which caches header & body output \& for later inspection instead of writing it to STDOUT. \& \& \- $Response\->Redirect() under SoftRedirect 1 will not first Clear() buffer \& \& \- $Response\->Redirect() in an XMLSubs will work now ... behavior \& of $Response\->Flush() being turned off in an XMLSubs was interfering with this. \& \& + srand() init tracking done better, thanks for patch from Ime Smits \& \& + Added file/directory being used for precompilation in \& Apache::ASP\->Loader($file, ...) to output like: \& \& [Mon Feb 04 20:19:22 2002] [error] [asp] 4215 (re)compiled 22 scripts \& of 22 loaded for $file \& \& This is so that when precompiling multiple web sites \& each with different directories, one can easier see the \& compile output relevant to the Loader() command being run. \& \& + better decomp of Apache::ASP site build files at ./build/* files, \& which is good should anyone look at it for ideas. \& \& + improved test suite to error when unintended output results from \& t/*.t test scripts. \& \& \- () now supported in XMLSubsMatch config, added xmlsubsmatch.t test... \& specifically a config like \& \& PerlSetVar (aaa|bbb):\ew+ \& \& should now work. Thanks for bug report from David Kulp. \& \& + Added an early srand() for better $ServerID creation \& \& + Work around for DSO problems where $r is not always correctly \& defined in Apache::ASP::handler(). Thanks to Tom Lear for patch. .Ve .ie n .IP "$VERSION = 2.31; $DATE=""01/22/2002"";" 4 .el .IP "\f(CW$VERSION\fR = 2.31; \f(CW$DATE\fR=``01/22/2002'';" 4 .IX Item "$VERSION = 2.31; $DATE=01/22/2002;" .Vb 3 \& + $Server\->MapInclude() API extension created to wrap up Apache::ASP::SearchDirs \& functionality so one may do an conditional check for an include existence before \& executing $Response\->Include(). Added API test to server.t \& \& + $Server\->Transfer() now allows arguments like $Response\->Include(), and now acts just \& as a wrapper for: \& \& $Response\->Include($file, @args); \& $Response\->End(); \& \& added test case at t/server_transfer.t \& \& + Removed dependency of StatINC functionality on Apache::Symbol. Apache::Symbol \& is no longer required. Added test of t/stat_inc.t for correct StatINC initialization \& for platforms where Devel::Symdump is present. \& \& + Better error message when $Request\->Params has not been defined with RequestParams \& config & it gets used in script. Added test case as t/request_params_none.t \& \& + Directories cannot now be included as scripts via $Response\->Include(), added \& test case to t/include.t \& \& \- No longer make $Response\->Flush dependent on $Response\->IsClientConnected() to \& be true to write output to client. There have been spurious errors reported \& about the new ( >= 2.25 ) IsClientConnected code, and this will limit the impact \& of that functionality possibly not working still to those users explicitly using \& that API. \& \& + $Response\->AddHeader($header_name, $value) now will set $Response members \& for these headers: Content\-Type, Cache\-Control, Expires. This is to avoid \& both the application & Apache::ASP sending out duplicate headers. Added \& test cases for this to t/response.t \& \& + split up Bundle::Apache::ASP into that, and Bundle::Apache::ASP::Extra \& the former with just the required modules to run, and the latter \& for extra functionality in Apache::ASP \& \& + new $Request\->{Method} member to return $r\->method of GET or POST that \& client browser is requesting, added t/request.t sub test to cover this member. .Ve .ie n .IP "$VERSION = 2.29; $DATE=""11/19/2001"";" 4 .el .IP "\f(CW$VERSION\fR = 2.29; \f(CW$DATE\fR=``11/19/2001'';" 4 .IX Item "$VERSION = 2.29; $DATE=11/19/2001;" .Vb 2 \& +Added some extra help text to the ./cgi/asp \-\-help message \& to clarify how to pass arguments to a script from the command line. \& \& +When using $Server\->Mail() API, if Content\-Type header is set, \& and MIME\-Version is not, then a "MIME\-Version: 1.0" header will be sent \& for the email. This is correct according to RFC 1521 which specifies \& for the first time the Content\-Type: header for email documents. \& Thanks to Philip Mak for pointing out this correct behavior. \& \& +Made dependent on MLDBM::Sync version .25 to pass the taint_check.t test \& \& +Improved server_mail.t test to work with mail servers were relaying is denied \& \& +Added tags to MailErrorsTo email \& \& \-\-Fixed SessionCount / Session_OnEnd bug, where these things were not \& working for $Sessions that never had anything written to them. \& This bug was introduced in 2.23/2.25 release. \& \& There was an optimization in 2.23/2.25 where a $Session that was never \& used does not write its state lock file & dbm files to disk, only if \& it gets written too like $Session\->{MARK}++. Tracking of these NULL $Sessions \& then is handled solely in the internal database. For $Session garbage \& collection though which would fire Session_OnEnd events and update \& SessionCount, the Apache::ASP::State\->GroupMembers() function was just \& looking for state files on disk ... now it looks in the internal database \& too for SessionID records for garbage collection. \& \& Added a test at ./t/session_events.t for these things. \& \& +Some optimizations for $Session API use. \& \& +Added support for XSLT via XML::LibXSLT, patch courtesy of Michael Buschauer \& \& \-Got rid of an warning when recompiling changing includes under perl 5.6.1... \& undef($code) method did not work for this perl version, rather undef(&$code) does. \& Stopped using using Apache::Symbol for this when available. \& \& \-Make Apache::ASP script run under perl taint checking \-T for perl 5.6.1... \& $code =~ tr///; does not work to untaint here, so much use the slower: \& $code =~ /^(.*)$/s; $code = $1; method to untaint. \& \& \-Check for inline includes changing, included in a dynamic included \& loaded at runtime via $Response\->Include(). Added test case for \& this at t/include_change.t. If an inline include of a dynamic include \& changes, the dynamic include should get recompiled now. \& \& \-Make OK to use again with PerlTaintCheck On, with MLDBM::Sync 2.25. \& Fixed in ASP.pm, t/global.asa, and created new t/taint_check.t test script \& \& +Load more modules when Apache::ASP is loaded so parent will share more \& with children httpd: \& Apache::Symbol \& Devel::Symdump \& Config \& lib \& MLDBM::Sync::SDBM_File \& \& +When FileUploadMax bytes is exceeded for a file upload, there will not \& be an odd error anymore resulting from $CGI::POST_MAX being triggered, \& instead the file upload input will simply be ignored via $CGI::DISABLE_UPLOADS. \& This gives the developer the opportunity to tell the user the the file upload \& was too big, as demonstrated by the ./site/eg/file_upload.asp example. \& \& To not let the web client POST a lot of data to your scripts as a form \& of a denial of service attack use the apache config LimitRequestBody for the \& max limits. You can think of PerlSetVar FileUploadMax as a soft limit, and \& apache\*(Aqs LimitRequestBody as a hard limit. \& \& \-\-Under certain circumstances with file upload, it seems that IsClientConnected() \& would return an aborted client value from $r\->connection\->aborted, so \& the buffer output data would not be flushed to the client, and \& the HTML page would return to the browser empty. This would be under \& normal file upload use. One work\-around was to make sure to initialize \& the $Request object before $Response\->IsClientConnected is called, \& then $r\->connection\->aborted returns the right value. \& \& This problem was probably introduced with IsClientConnected() code changes \& starting in the 2.25 release. .Ve .ie n .IP "$VERSION = 2.27; $DATE=""10/31/2001"";" 4 .el .IP "\f(CW$VERSION\fR = 2.27; \f(CW$DATE\fR=``10/31/2001'';" 4 .IX Item "$VERSION = 2.27; $DATE=10/31/2001;" .Vb 4 \& + Wrapped call to $r\->connection\->fileno in eval {} so to \& preserve backwards compatibility with older mod_perl versions \& that do not have this method defined. Thanks to Helmut Zeilinger \& for catching this. \& \& + removed ./dev directory from distribution, useless clutter \& \& + Removed dependency on HTTP::Date by taking code into \& Apache::ASP as Apache::ASP::Date. This relieves \& the dependency of Apache::ASP on libwww LWP libraries. \& If you were using HTTP::Date functions before without loading \& "use HTTP::Date;" on your own, you will have to do this now. \& \& + Streamlined code execution. Especially worked on \& $Response\->IsClientConnected which gets called during \& a normal request execution, and got rid of IO::Select \& dependency. Some function style calls instead of OO style \& calls where private functions were being invokes that one \& would not need to override. \& \& \- Fixed possible bug when flushing a data buffer where there \& is just a \*(Aq0\*(Aq in it. \& \& + Updated docs to note that StateCache config was deprecated \& as of 2.23. Removed remaining code that referenced the config. \& \& + Removed references to unused OrderCollections code. \& \& \- Better Cache meta key, lower chance of collision with \& unrelated data since its using the full MD5 keyspace now \& \& + Optimized some debugging statements that resulted \& from recent development. \& \& + Tie::TextDir .04 and above is supported for StateDB \& and CacheDB settings with MLDBM::Sync .21. This is good for \& CacheDB where output is larger and there are not many \& versions to cache, like for XSLTCache, where the site is \& mostly static. \& \& + Better RESOURCES section to web site, especially with adding \& some links to past Apache::ASP articles & presentations. .Ve .ie n .IP "$VERSION = 2.25; $DATE=""10/11/2001"";" 4 .el .IP "\f(CW$VERSION\fR = 2.25; \f(CW$DATE\fR=``10/11/2001'';" 4 .IX Item "$VERSION = 2.25; $DATE=10/11/2001;" .Vb 5 \& + Improved ./site/apps/search application, for better \& search results at Apache::ASP site. Also, reengineered \& application better, with more perl code moved to global.asa. \& Make use of MLDBM::Sync::SDBM_File, where search database \& before was engineering around SDBM_File\*(Aqs shortcomings. \& \& \- Fix for SessionSerialize config, which broke in 2.23 \& Also, added t/session_serialize.t to test suite to catch \& this problem in the future. .Ve .ie n .IP "$VERSION = 2.23; $DATE=""10/11/2001"";" 4 .el .IP "\f(CW$VERSION\fR = 2.23; \f(CW$DATE\fR=``10/11/2001'';" 4 .IX Item "$VERSION = 2.23; $DATE=10/11/2001;" .Vb 5 \& +Make sure a couple other small standard modules get loaded \& upon "PerlModule Apache::ASP", like Time::HiRes, Class::Struct, \& and MLDBM::Serializer::Data::Dumper. If not available \& these modules won\*(Aqt cause errors, but will promote child httpd \& RAM sharing if they are. \& \& \-XMLSubs args parsing fix so an arg like z\-index \& does not error under UseStrict. This is OK now: \& \& HTML \& \& \-Only remove outermost \& \& These settings require that buffering be enabled, as \& Apache::ASP will parse through the buffer to parse the URLs. \& \& With SessionQueryParse on, it will just parse non\-absolute \& URLs, but with SessionQueryParseMatch set to some server \& url regexp, like ^http://localhost , will also parse \& in the session id for URLs that match that. \& \& When testing, the performance hit from this parsing \& a script dropped from 12.5 hits/sec on my WinNT box \& to 11.7 hits per second for 1K of buffered output. \& The difference is .007 of my PII300\*(Aqs processing power \& per second. \& \& For 10K of output then, my guess is that this speed \& of script, would be slowed to 6.8 hits per second. \& This kind of performance hit would also slow a \& script running at 40 hits per second on a UNIX box \& to 31 hits/sec for 1K, and to 11 hits/sec for 10K parsed. \& \& Your mileage may vary and you will have to test the difference \& yourself. Get yourself a valid URL with a session\-id in \& it, and run it through ab, or Socrates, with SessionQuery \& turned on, and then with SessionQueryParse set to see \& the difference. SessionQuery just enables of session id \& setting from the query string but will not auto parse urls. \& \& \-If buffering, Content\-Length will again be set. \& It broke, probably while I was tuning in the past \& couple versions. \& \& +UseStrict setting compiles all scripts including \& global.asa with "use strict" turned on for catching \& more coding errors. With this setting enabled, \& use strict errors die during compilation forcing \& Apache::ASP to try to recompile the script until \& successful. \& \& \-Object use in includes like $Response\->Write() \& no longer error with "use strict" programming. \& \& +SessionQuery config setting with $Server\->URL($url, { %params } ) \& alpha API extensions to enable cookieless sessions. \& \& +Debugging not longer produces internal debugging \& by default. Set to \-1,\-2 for internal debugging \& for Debug settings 1 & 2. \& \& +Both StateSerializer & StateDB can be changed \& without affecting a live web site, by storing \& the configurations for $Application & $Session \& in an internal database, so that if $Session was \& created with SDBM_File for the StateDB (default), \& it will keep this StateDB setting until it ends. \& \& +StateSerializer config setting. Default Data::Dumper, \& can also be set to Storable. Controls how data is \& serialized before writing to $Application & $Session. \& \& +Beefed up the make test suite. \& \& +Improved the locking, streamlining a bit of the \& $Application / $Session setup process. Bench is up to \& 22 from 21 hits / sec on dev NT box. \& \& +Cut more fat for faster startup, now on my dev box \& I get 44 hits per sec Apache::ASP vs. 48 Embperl \& vs. 52 CGI via Apache::Registry for the HelloWorld Scripts. \& \& \-Improved linking for the online site documentation, \& where a few links before were bad. .Ve .ie n .IP "$VERSION = 0.17; $DATE=""11/15/99"";" 4 .el .IP "\f(CW$VERSION\fR = 0.17; \f(CW$DATE\fR=``11/15/99'';" 4 .IX Item "$VERSION = 0.17; $DATE=11/15/99;" .Vb 4 \& ++20%+ faster startup script execution, as measured by the \& HelloWorld bench. I cut a lot of the fat out of \& the code, and is now at least 20% faster on startup \& both with and without state. \& \& On my dev (NT, apache 1.3.6+mod_perl) machine, I now get: \& \& 42 hits per sec on Apache::ASP HelloWorld bench \& 46 hits per sec on Embperl (1.2b10) and \& 51 hits per sec for CGI Apache::Registry scripts \& \& Before Apache::ASP was clocking some 31 hits per sec. \& Apache::ASP also went from 75 to 102 hits per second \& on Solaris. \& \& +PerlTaintCheck On friendly. This is mod_perl\*(Aqs way \& of providing \-T taint checking. When Apache::ASP \& is used with state objects like $Session or $Application, \& MLDBM must also be made taint friendly with: \& \& $MLDBM::RemoveTaint = 1; \& \& which could be put in the global.asa. Documented. \& \& +Added $Response\->ErrorDocument($error_code, $uri_or_string) \& API extension which allows for setting of Apache\*(Aqs error \& document at runtime. This is really just a wrapper \& for Apache\->custom_response() renamed so it syncs with \& the Apache ErrorDocument config setting. Updated \& documentation, and added error_document.htm example. \& \& =OrderCollections setting was added, but then REMOVED \& because it was not going to be used. It bound \& $Request\->* collections/hashes to Tie::IxHash, so that data \& in those collections would be read in the order the \& browser sent it, when eaching through or with keys. \& \& \-global.asa will be reloaded when changed. This broke \& when I optimized the modification times with (stat($file))[9] \& rather than "use File::stat; stat($file)\->mtime" \& \& \-Make Apache::ASP\->Loader() PerlRestartHandler safe, \& had some unstrict code that was doing the wrong thing. \& \& \-IncludesDir config now works with DynamicIncludes. \& \& +DebugBufferLength feature added, giving control to \& how much buffered output gets shown when debugging errors. \& \& ++Tuning of $Response\->Write(), which processes all \& static html internally, to be almost 50% faster for \& its typical use, when BufferingOn is enabled, and \& CgiHeaders are disabled, both being defaults. \& \& This can show significant speed improvements for tight \& loops that render ASP output. \& \& +Auto linking of ./site/eg/ text to example scripts \& at web site. \& \& +$Application\->GetSession($session_id) API extension, useful \& for managing active user sessions when storing session ids \& in $Application. Documented. \& \& \-disable use of flock() on Win95/98 where it is unimplemented \& \& \-@array context of $Request\->Form(\*(Aqname\*(Aq) returns \& undef when value for \*(Aqname\*(Aq is undefined. Put extra \& logic in there to make sure this happens. .Ve .ie n .IP "$VERSION = 0.16; $DATE=""09/22/99"";" 4 .el .IP "\f(CW$VERSION\fR = 0.16; \f(CW$DATE\fR=``09/22/99'';" 4 .IX Item "$VERSION = 0.16; $DATE=09/22/99;" .Vb 3 \& \-$Response\->{Buffer} and PerlSetVar BufferingOn \& configs now work when set to 0, to unbuffer output, \& and send it out to the web client as the script generates it. \& \& Buffering is enabled by default, as it is faster, and \& allows a script to error cleanly in the middle of execution. \& \& +more bullet proof loading of Apache::Symbol, changed the \& way Apache::ASP loads modules in general. It used to \& check for the module to load every time, if it hadn\*(Aqt loaded \& successfully before, but now it just tries once per httpd, \& so the web server will have to be restarted to see new installed \& modules. This is just for modules that Apache::ASP relies on. \& \& Old modules that are changed or updated with an installation \& are still reloaded with the StatINC settings if so configured. \& \& +ASP web site wraps around

\&  tags now to override the other font used for the text
\&  areas.  The spacing was all weird in Netscape before
\&  for 
 sections.
\&
\& \-Fixed Content\-Length calculation when using the Clean
\&  option, so that the length is calculated after the HTML
\&  is clean, not before.  This would cause a browser to 
\&  hang sometimes.
\&
\& +Added IncludesDir config option that if set will also be
\&  used to check for includes, so that includes may easily be
\&  shared between applications.  By default only Global and 
\&  the directory the script is in are checked for includes.
\&
\&  Also added IncludesDir as a possible configuration option
\&  for Apache::ASP\->Loader()
\&
\& \-Re\-enabled the Application_OnStart & OnEnd events, after
\&  breaking them when implementing the AllowApplicationState
\&  config setting.
\&
\& +Better pre\-fork caching ... StatINC & StatINCMatch are now 
\&  args for Apache::ASP\->Loader(), so StatINC symbols loading
\&  may be done pre\-fork and shared between httpds.  This lowers
\&  the child httpd init cost of StatINC.  Documented.
\&
\& +Made Apache::ASP Basic Authorization friendly so authentication
\&  can be handled by ASP scripts.  If AuthName and AuthType Apache
\&  config directives are set, and a $Response\->{Status} is set to 
\&  401, a user will be prompted for username/password authentication
\&  and the entered data will show up in ServerVariables as:
\&    $env = $Request\->ServerVariables
\&    $env\->{REMOTE_USER} = $env\->{AUTH_USER} = username
\&    $env\->{AUTH_PASSWD} = password
\&    $env\->{AUTH_NAME}   = your realm
\&    $env\->{AUTH_TYPE}   = \*(AqBasic\*(Aq
\&
\&  This is the same place to find auth data as if Apache had some 
\&  authentication handler deal with the auth phase separately.
\&
\& \-MailErrorsTo should report the right file now that generates
\&  the error.
.Ve
.ie n .IP "$VERSION = 0.15; $DATE=""08/24/1999"";" 4
.el .IP "\f(CW$VERSION\fR = 0.15; \f(CW$DATE\fR=``08/24/1999'';" 4
.IX Item "$VERSION = 0.15; $DATE=08/24/1999;"
.Vb 5
\& \-\-State databases like $Session, $Application are 
\&  now tied/untied to every lock/unlock triggered by read/write 
\&  access.  This was necessary for correctness issues, so that 
\&  database file handles are flushed appropriately between writes
\&  in a highly concurrent multi\-process environment.
\&
\&  This problem raised its ugly head because under high volume, 
\&  a DB_File can become corrupt if not flushed correctly.  
\&  Unfortunately, there is no way to flush SDBM_Files & DB_Files 
\&  consistently other than to tie/untie the databases every access.
\&
\&  DB_File may be used optionally for StateDB, but the default is
\&  to use SDBM_File which is much faster, but limited to 1024 byte
\&  key/value pairs.
\&
\&  For SDBM_Files before, if there were too many concurrent 
\&  writes to a shared database like $Application, some of the 
\&  writes would not be saved because another process
\&  might overwrite the changes with its own.
\&
\&  There is now a 10 fold performance DECREASE associated
\&  with reading from and writing to files like $Session 
\&  and $Application.  With rough benchmarks I can get about
\&  100 increments (++) now per second to $Session\->{count}, where
\&  before I could get 1000 increments / second.  
\&
\&  You can improve this if you have many reads / writes happening
\&  at the same time, by placing locking code around the group like
\&  
\&        $Session\->Lock();
\&        $Session\->{count}++;
\&        $Session\->{count}++;
\&        $Session\->{count}++;
\&        $Session\->UnLock();     
\&
\&  This method will reduce the number of ties to the $Session database
\&  from 6 to 1 for this kind of code, and will improve the performance
\&  dramatically.
\&
\&  Also, instead of using explicit $Session locking, you can 
\&  create an automatic lock on $Session per script by setting
\&  SessionSerialize in your config to 1.  The danger here is
\&  if you have any long running scripts, the user will have
\&  to wait for it to finish before another script can be run.
\&
\&  To see the number of lock/unlocks or ties/unties to each database
\&  during a script execution, look at the last lines of debug output
\&  to your error log when Debug is set to 1.  This can help you
\&  performance tweak access to these databases.
\&
\& +Updated documentation with new config settings and
\&  API extensions.
\&
\& +Added AllowApplicationState config option which allows
\&  you to leave $Application undefined, and will not
\&  execute Application_OnStart or Application_OnEnd.
\&  This can be a slight performance increase of 2\-3% if
\&  you are not using $Application, but are using $Session.
\&
\& +Added $Session\->Lock() / $Session\->UnLock() API routines
\&  necessary additions since access to session is not
\&  serialized by default like IIS ASP.  Also prompted
\&  by change in locking code which retied to SDBM_File
\&  or DB_File each lock.  If you $Session\->Lock / UnLock
\&  around many read/writes, you will increase performance.
\&
\& +Added StateCache config which, if set will cache
\&  the file handle locks for $Application and an internal 
\&  database used for tracking $Session info.  This caching can 
\&  make an ASP application perform up to 10% faster,
\&  at a cost of each web server process holding 2 more 
\&  cached file handles open, per ASP application using
\&  this configuration.  The data written to or read from
\&  these state databases is not cached, just the locking 
\&  file handles are held open.
\&
\& \-Added in much more locking in session manager 
\&  and session garbage collector to help avoid collisions
\&  between the two.  There were definite windows that the
\&  two would collide in, during which bad things could 
\&  happen on a high volume site.
\&
\& \-Fixed some warnings in DESTROY and ParseParams()
.Ve
.ie n .IP "$VERSION = 0.14; $DATE=""07/29/1999"";" 4
.el .IP "\f(CW$VERSION\fR = 0.14; \f(CW$DATE\fR=``07/29/1999'';" 4
.IX Item "$VERSION = 0.14; $DATE=07/29/1999;"
.Vb 4
\& \-CGI & StatINC or StatINCMatch would have bad results
\&  at times, with StatINC deleting dynamically compiled
\&  CGI subroutines, that were imported into other scripts
\&  and modules namespaces.
\&
\&  A couple tweaks, and now StatINC & CGI play nice again ;)
\&  StatINCMatch should be safe to use in production with CGI. 
\&  This affects in particular environments that use file upload, 
\&  since CGI is loaded automatically by Apache::ASP to handle 
\&  file uploads.
\&
\&  This fix should also affect other seemingly random 
\&  times when StatINC or StatINCMatch don\*(Aqt seem to do 
\&  the right thing.
\&
\& +use of ASP objects like $Response are now "use strict"
\&  safe in scripts, while UniquePackages config is set.
\&
\& +Better handling of "use strict" errors in ASP scripts.
\&  The error is detected, and the developer is pointed to the 
\&  Apache error log for the exact error.  
\&
\&  The script with "use strict" errors will be recompiled again.  Its seems 
\&  though that "use strict" will only throw its error once, so that a script 
\&  can be recompiled with the same errors, and work w/o any use strict
\&  error messaging.
.Ve
.ie n .IP "$VERSION = 0.12; $DATE=""07/01/1999"";" 4
.el .IP "\f(CW$VERSION\fR = 0.12; \f(CW$DATE\fR=``07/01/1999'';" 4
.IX Item "$VERSION = 0.12; $DATE=07/01/1999;"
.Vb 2
\& \-Compiles are now 10 +times faster for scripts with lots of big
\&  embedded perl blocks <% #perl %>
\&
\&  Compiles were slow because of an old PerlScript compatibility
\&  parsing trick where $Request\->QueryString(\*(Aqhi\*(Aq)\->{item}
\&  would be parsed to $Request\->QueryString(\*(Aqhi\*(Aq) which works.
\&  I think the regexp that I was using had O(n^2) characteristics
\&  and it took a really big perl block to 10 +seconds to parse
\&  to understand there was a problem :(
\&
\&  I doubt anyone needed this compatibility, I don\*(Aqt even see
\&  any code that looks like this in the online PerlScript examples,
\&  so I\*(Aqve commented out this parsing trick for now.  If you 
\&  need me to bring back this functionality, it will be in the 
\&  form of a config setting.
\&
\&  For information on PerlScript compatibility, see the PerlScript
\&  section in the ASP docs.
\&
\& \-Added UniquePackages config option, that if set brings back 
\&  the old method of compiling each ASP script into its own
\&  separate package.  As of v.10, scripts are compiled by default
\&  into the same package, so that scripts, dynamic includes & global.asa
\&  can share globals.  This BROKE scripts in the same ASP Application
\&  that defined the same sub routines, as their subs would redefine
\&  each other.  
\&
\&  UniquePackages has scripts compiled into separate perl packages,
\&  so they may define subs with the same name, w/o fear of overlap.
\&  Under this settings, scripts will not be able to share globals.  
\&
\& \-Secure field for cookies in $Response\->Cookies() must be TRUE to 
\&  force cookie to be secure.  Before, it just had to be defined, 
\&  which gave wrong behavior for Secure => 0. 
\&
\& +$Response\->{IsClientConnected} set to one by default.  Will
\&  work out a real value when I upgrade to apache 1.3.6.  This
\&  value has no meaning before, as apache aborts the perl code
\&  when a client drops its connection in earlier versions.
\&
\& +better compile time debugging of dynamic includes, with 
\&  Debug 2 setting
\&
\& +"use strict" friendly handling of compiling dynamic includes
\&  with errors
.Ve
.ie n .IP "$VERSION = 0.11; $DATE=""06/24/1999"";" 4
.el .IP "\f(CW$VERSION\fR = 0.11; \f(CW$DATE\fR=``06/24/1999'';" 4
.IX Item "$VERSION = 0.11; $DATE=06/24/1999;"
.Vb 1
\& +Lots of documentation updates
\&
\& +The MailHost config option is the smtp server used for 
\&  relay emails for the Mail* config options.
\&
\& +MailAlertTo config option used for sending a short administrative
\&  alert for an internal ASP error, server code 500.  This is the 
\&  compliment to MailErrorsTo, but is suited for sending a to a
\&  small text based pager.  The email sent by MailErrorsTo would
\&  then be checked by the web admin for quick response & debugging
\&  for the incident. 
\&
\&  The MailAlertPeriod config specifies the time in minutes during 
\&  which only one alert will be sent, which defaults to 20.
\&
\& +MailErrorsTo config options sends the results of a 500 error
\&  to the email address specified as if Debug were set to 2.
\&  If Debug 2 is set, this config will not be on, as it is
\&  for production use only.  Debug settings less than 2 only 
\&  log errors to the apache server error log.
\&
\& \-StatINCMatch / StatINC can be used in production and work
\&  even after a server graceful restart, which is essential for 
\&  a production server.
\&
\& \-Content\-Length header is set again, if BufferingOn is set, and
\&  haven\*(Aqt $Response\->Flush()\*(Aqd.  This broke when I introduce
\&  the Script_OnEnd event handler.
\&
\& +Optimized reloading of the GlobalPackage perl module upon changes, 
\&  so that scripts and dynamic includes don\*(Aqt have to be recompiled.  
\&  The global.asa will still have to be though.  Since we started
\&  compiling all routines into a package that can be named with
\&  GlobalPackage, we\*(Aqve been undeffing compiled scripts and includes
\&  when the real GlobalPackage changed on disk, as we do a full sweep
\&  through the namespace.  Now, we skip those subs that we know to 
\&  be includes or scripts. 
\&
\& \-Using Apache::Symbol::undef() to undefine precompiled scripts
\&  and includes when reloading those scripts.  Doing just an undef() 
\&  would sometimes result in an "active subroutine undef" error.
\&  This bug came out when I started thrashing the StatINC system
\&  for production use.
\&
\& +StatINCMatch setting created for production use reloading of
\&  perl modules.  StatINCMatch allows StatINC reloading of a
\&  subset of all the modules defined in %INC, those that match
\&  $module =~ /$StatINCMatch/, where module is some module name
\&  like Class/Struct.pm
\&
\& +Reoptimized pod comment parsing.  I slowed it down to sync
\&  lines numbers in the last version, but found another corner I could cut.
.Ve
.ie n .IP "$VERSION = 0.10; $DATE=""05/24/1999"";" 4
.el .IP "\f(CW$VERSION\fR = 0.10; \f(CW$DATE\fR=``05/24/1999'';" 4
.IX Item "$VERSION = 0.10; $DATE=05/24/1999;"
.Vb 1
\& += improvement; \- = bug fix
\&
\& +Added index.html file to ./eg to help people wade through
\&  the examples.  This one has been long overdue.
\&
\& +Clean config option, or setting $Response\->{Clean} to 1 \- 9,
\&  uses HTML::Clean to compress text/html output of ASP scripts.
\&  I like the Clean 1 setting which is lightweight, stripping 
\&  white space for about 10% compression, at a cost of less than
\&  a 5% performance penalty.
\&
\& +Using pod style commenting no longer confuses the line
\&  numbering.  ASP script line numbers are almost exactly match
\&  their compiled perl version, except that normal inline includes
\&  (not dynamic) insert extra text which can confuse line numbering.
\&  If you want perl error line numbers to entirely sync with your 
\&  ASP scripts, I would suggest learning how to use dynamic includes,
\&  as opposed to inline includes.
\&
\& \-Wrapped StatINC reloading of libs in an eval, and capturing
\&  error for Debug 2 setting.  This makes changing libs with StatINC
\&  on a little more friendly when there are errors. 
\&
\& \-$Request\->QueryString() now stores multiple values for the 
\&  same key, just as $Request\->Form() has since v.07.  In
\&  wantarray() context like @vals = $Request\->QueryString(\*(Aqdupkey\*(Aq),
\&  @vals will store whatever values where associated with dupkey
\&  in the query string like (1,2) from: ?dupkey=1&dupkey=2
\&
\& +The GlobalPackage config directive may be defined
\&  to explicitly set the perl module that all scripts and global.asa
\&  are compiled into.
\&
\& \-Dynamic includes may be in the Global directory, just like
\&  normal includes.
\&
\& +Perl script generated from asp scripts should match line
\&  for line, seen in errors, except when using inline (default) 
\&  includes, pod comments, or <% #comment %> perl comments, which 
\&  will throw off the line counts by adding text, removing
\&  text, or having an extra newline added, respectively.
\&
\& \-Script_OnEnd may now send output to the browser.  Before
\&  $main::Response\->End() was being called at the end of the
\&  main script preventing further output.
.Ve
.Sp
++All scripts are compiled as routines in a namespace uniquely
  defined by the global.asa of the \s-1ASP\s0 application.  Thus,
  scripts, includes, and global.asa routines will share
  all globals defined in the global.asa namespace.   This means
  that globals between scripts will be shared, and globals
  defined in a global.asa will be available to scripts.
.Sp
.Vb 2
\&  Scripts used to have their own namespace, thus globals
\&  were not shared between them.
\&
\& +a \-o $output_dir switch on the ./cgi/asp script allows
\&  it to execute scripts and write their output to an output
\&  directory.  Useful for building static html sites, based on
\&  asp scripts.  An example use would be:
\&
\&    asp \-b \-o out *.asp
\&
\&  Without an output directory, script output is written to STDOUT
.Ve
.ie n .IP "$VERSION = 0.09; $DATE=""04/22/1999"";" 4
.el .IP "\f(CW$VERSION\fR = 0.09; \f(CW$DATE\fR=``04/22/1999'';" 4
.IX Item "$VERSION = 0.09; $DATE=04/22/1999;"
.Vb 1
\& +Updated Makefile.PL optional modules output for CGI & DB_File
\&
\& +Improved docs on $Response\->Cookies() and $Request\->Cookies()
\&
\& +Added PERFORMANCE doc to main README, and added sub section
\&  on precompiling scripts with Apache::ASP\->Loader()
\&
\& +Naming of CompileIncludes switched over to DynamicIncludes 
\&  for greater clarity.
\&
\& +Dynamic includes can now reference ASP objects like $Session
\&  w/o the $main::* syntax.  These subs are no longer anonymous
\&  subs, and are now compiled into the namespace of the global.asa package.
\&
\& +Apache::ASP\->Loader() precompiles dynamic includes too. Making this work
\&  required fixing some subtle bugs / dependencies in the compiling process.
\&
\& +Added Apache::ASP\->Loader() similar to Apache::RegistryLoader for
\&  precompiling ASP scripts.  Precompile a whole site at server 
\&  startup with one function call.
\&
\& +Prettied the error messaging with Debug 2.
\&
\& +$Response\->Debug(@args) debugging extension, which
\&  allows a developer to hook into the module\*(Aqs debugging,
\&  and only have @args be written to error_log when Debug is greater
\&  than 0.
\&
\& \-Put write locking code around State writes, like $Session
\&  and $Application.  I thought I fixed this bug a while ago.
\&
\& \-API change: converted $Session\->Timeout() and $Session\->SessionID() 
\&  methods into $Session\->{Timeout} and $Session\->{SessionID} properties.
\&  The use of these properties as methods is deprecated, but 
\&  backwards compatibility will remain.  Updated ./eg/session.asp
\&  to use these new properties.
\&
\& +Implemented $Response\->{PICS} which if set sends out a PICS\-Label
\&  HTTP header, useful for ratings.
\&
\& +Implemented $Response\->{CacheControl} and $Response\->{Charset} members.
\&  By default, CacheControl is \*(Aqprivate\*(Aq, and this value gets sent out
\&  every request as HTTP header Cache\-Control.  Charset appends itself
\&  onto the content type header.
\&
\& +Implemented $Request\->BinaryRead(), $Request\->{TotalBytes},
\&  documented them, and updated ./eg/form.asp for an example usage. 
\&
\& +Implemented $Response\->BinaryWrite(), documented, and created
\&  and example in ./eg/binary_write.htm
\&
\& +Implemented $Server\->MapPath() and created example of its use
\&  in ./eg/server.htm
\&
\& \-$Request\->Form() now reads file uploads correctly with 
\&  the latest CGI.pm, where $Request\->Form(\*(Aqfile_field\*(Aq) returns
\&  the actual file name uploaded, which can be used as a file handle
\&  to read in the data.  Before, $Request\->Form(\*(Aqfile_field\*(Aq) would
\&  return a glob that looks like *Fh::filename, so to get the file
\&  name, you would have to parse it like =~ s/^\e*Fh\e:\e://,
\&  which you no longer have to do.  As long as parsing was done as
\&  mentioned, the change should be backwards compatible.
\&
\& +Updated  +enhanced documentation on file uploads.  Created extra
\&  comments about it as an FAQ, and under $Response\->Form(), the latter
\&  being an obvious place for a developer to look for it.
\&
\& +Updated ./eg/file_upload.asp to show use of non file form data, 
\&  with which we had a bug before.
\&
\& +Finished retieing *STDIN to cached STDIN contents, so that 
\&  CGI input routines may be used transparently, along side with
\&  use of $Request\->Form()
\&
\& +Cleaned up and optimized $Request code
\&
\& +Updated documentation for CGI input & file uploads.  Created
\&  file upload FAQ.
\&
\& +Reworked ./eg/cgi.htm example to use CGI input routines
\&  after doing a native read of STDIN.
\&
\& ++Added dynamic includes with 
\&  extension.  This style of include is compiled as an anonymous sub & 
\&  cached, and then executed with @args passed to the subroutine for 
\&  execution.  This is include may also be rewritten as a new API 
\&  extension: $Response\->Include(\*(Aqfile\*(Aq, @args)
\&
\& +Added ./eg/compiled_includes.htm example documenting new dynamic includes.
\&
\& +Documented SSI: native file includes, and the rest with filtering 
\&  to Apache::SSI
\&
\& +Turned the documentation of Filter config to value of Off so 
\&  people won\*(Aqt cut and paste the On config by default.
\&
\& +Added SecureSession config option, which forces session cookie to 
\&  be sent only under https secured www page requests.
\&
\& +Added StateDB config option allows use of DB_File for $Session, since 
\&  default use of SDBM_File is limited.  See StateDB in README.
\&
\& +file include syntax w/o quotes supported like 
\&
\& +Nested includes are supported, with includes including each other.
\&  Recursive includes are detected and errors out when an include has been 
\&  included 100 times for a script.  Better to quit early than 
\&  have a process spin out of control. (PORTABLE ? probably not)
\&
\& +Allow  notation w/o quotes around file names
\&
\& \-PerlSetEnv apache conf setting now get passed through to 
\&  $Request\->ServerVariables. This update has ServerVariables 
\&  getting data from %ENV instead of $r\->cgi_env
\&
\& +README FAQ for PerlHandler errors
.Ve
.ie n .IP "$VERSION = 0.08; $DATE=""02/06/1999"";" 4
.el .IP "\f(CW$VERSION\fR = 0.08; \f(CW$DATE\fR=``02/06/1999'';" 4
.IX Item "$VERSION = 0.08; $DATE=02/06/1999;"
.Vb 3
\& ++SSI with Apache::Filter & Apache::SSI, see config options & ./eg files
\&  Currently filtering only works in the direction Apache::ASP \-> Apache::SSI,
\&  will not work the other way around, as SSI must come last in a set of filters
\&
\& +SSI file includes may reference files in the Global directory, better 
\&  code sharing
\&
\& \- <% @array... %> no longer dropped from code.
\&
\& +perl =pod comments are stripped from script before compiling, and associated
\&  PodComments configuration options.
\&
\& +Command line cgi/asp script takes various options, and allows execution
\&  of multiple asp scripts at one time.  This script should be used for
\&  command line debugging.  This is also the beginning of building
\&  a static site from asp scripts with the \-b option, suppressing headers.
\&
\& +$Response\->AddHeader(\*(AqSet\-Cookie\*(Aq) works for multiple cookies.
\&
\& \-$Response\->Cookies(\*(Aqfoo\*(Aq, \*(Aq0\*(Aq) works, was dropping 0 because of boolean test
\&
\& \-Fixed up some config doc errors.
.Ve
.ie n .IP "$VERSION = 0.07; $DATE=""01/20/1999"";" 4
.el .IP "\f(CW$VERSION\fR = 0.07; \f(CW$DATE\fR=``01/20/1999'';" 4
.IX Item "$VERSION = 0.07; $DATE=01/20/1999;"
.Vb 1
\& \-removed SIG{_\|_WARN_\|_} handler, it was a bad idea.
\&
\& \-fixes file locking on QNX, work around poor flock porting
\&
\& +removed message about Win32::OLE on UNIX platforms from Makefile.PL
\&
\& \-Better lock garbage collection.  Works with StatINC seamlessly.
\&
\& \-Multiple select forms now work in array context with $Response\->Form()
\&        @values = $Response\->Form(\*(Aqmulti\*(Aq);
\&
\& \-Better CGI.pm compatibility with $r\->header_out(\*(AqContent\-type\*(Aq),
\&  improved garbage collection under modperl, esp. w/ file uploads
.Ve
.ie n .IP "$VERSION = 0.06; $DATE=""12/21/1998"";" 4
.el .IP "\f(CW$VERSION\fR = 0.06; \f(CW$DATE\fR=``12/21/1998'';" 4
.IX Item "$VERSION = 0.06; $DATE=12/21/1998;"
.Vb 1
\& +Application_OnStart & Application_OnEnd event handlers support.
\&
\& \-Compatible with CGI.pm 2.46 headers() 
\&
\& \-Compatible with CGI.pm $q = new CGI({}), caveat: does not set params 
\&
\& +use strict; followed by use of objects like $Session is fine.
\&
\& \-Multiple cookies may be set per script execution.
\&
\& +file upload implemented via CGI.pm
\&
\& ++global.asa implemented with events Session_OnStart and Session_OnEnd
\&  working appropriately.
\&
\& +StateDir configuration directive implemented.
\&  StateDir allows the session state directory to be specified separately 
\&  from the Global directory, useful for operating systems with caching file 
\&  systems.
\&
\& +StateManager config directive.  StateManager specifies how frequently
\&  Sessions are cleaned up, with 10 (default) meaning that old Sessions
\&  will be cleaned up 10 times per SessionTimeout period (default 20 minutes).
\&
\& +$Application\->SessionCount() implemented, non\-portable method.
\&        : returns the number of currently active sessions
\&
\& \-STOP button fix.  Users may hit STOP button during script 
\&  execution, and Apache::ASP will cleanup with a routine registered
\&  in Apache\*(Aqs $r\->register_cleanup.  Works well supposedly.
\&
\& +PerlScript compatibility work, trying to make ports smoother.
\&        : Collection emulator, no \->{Count} property
\&        : $.*(.*)\->{Item} parsed automatically, 
\&          shedding the \->{Item} for Collection support (? better way ?)
\&        : No VBScript dates support, just HTTP RFC dates with HTTP::Date
\&        : Win32::OLE::in not supported, just use "keys %{$Collection}"  
\&
\& +./cgi/asp script for testing scripts from the command line
\&        : will be upgraded to CGI method of doing asp
\&        : is not "correct" in anyway, so not documented for now
\&          but still useful
\&
\& +strips DOS carriage returns from scripts automatically, so that
\&  programs like FrontPage can upload pages to UNIX servers
\&  without perl choking on the extra \er characters.
.Ve
.ie n .IP "$VERSION = 0.05; $DATE=""10/19/1998"";" 4
.el .IP "\f(CW$VERSION\fR = 0.05; \f(CW$DATE\fR=``10/19/1998'';" 4
.IX Item "$VERSION = 0.05; $DATE=10/19/1998;"
.Vb 1
\& +Added PERFORMANCE doc, which includes benchmarks  +hints.
\&
\& +Better installation warnings and errors for other modules required. 
\&
\& \-Turned off StatINC in eg/.htaccess, as not everyone installs Devel::Symdump
\&
\& \-Fixed AUTOLOAD state bug, which wouldn\*(Aqt let you each through state
\&  objects, like %{$Session}, or each %$Session, (bug introduced in v.04)
\&
\& +Parses ASP white space better.  HTML output matches author\*(Aqs intent
\&  by better dealing with white space surrounding <% perl blocks %>
\&
\& \-Scalar insertion code <%=$foo%> can now span many lines.
\&
\& +Added include.t test script for includes.
\&
\& +Script recompiles when included files change.
\&
\& +Files can be included in script with 
\&  SSI  syntax, needs to be
\&  done in ASP module to allow compilation of included code and html 
\&  into script.  Future chaining with Apache::SSI will allow static 
\&  html includes, and other SSI directives
.Ve
.ie n .IP "$VERSION = 0.04; $DATE=""10/14/1998"";" 4
.el .IP "\f(CW$VERSION\fR = 0.04; \f(CW$DATE\fR=``10/14/1998'';" 4
.IX Item "$VERSION = 0.04; $DATE=10/14/1998;"
.Vb 1
\& +Example script eg/cgi.htm demonstrating CGI.pm use for output.
\&
\& +Optimized ASP parsing, faster and more legible executing code
\&        : try \*(Aqdie();\*(Aq in code with setting PerlSetVar Debug 2
\&
\& +Cleaned up code for running with \*(Aquse strict\*(Aq
\&
\& \-Fixed directory handle leak on Solaris, from not closing after opendir()
\&
\& +StatINC overhaul.  StatINC setting now works as it should, with 
\&  the caveat that exported functions will not be refreshed.
\&
\& +NoState setting optimization, disallows $Application & $Session
\&
\& +$Application\->*Lock() functions implemented
\&
\& \-SoftRedirect setting for those who want scripts to keep running
\&  after a Redirect()
\&
\& +SessionSerialize setting to lock session while script is running
\&        : Microsoft ASP style session locking
\&        : For a session, scripts execute one at a time 
\&        : NOT recommended use, please see note.
\&
\& \-MLDBM can be used for other things without messing up internal use
\&        : before if it was used with different DB\*(Aqs and serializers,
\&          internal state could be lost.
\&
\& \-\-State file locking.  Corruption worries, and loss of data no more.
\&
\& +CGI header support, developer can use CGI.pm for *output*, or just print()
\&        : print "Set\-Cookie: test=cookie\en", and things will just work
\&        : use CGI.pm for output
\&        : utilizes $r\->send_cgi_header(), thanks Doug!
\&
\& +Improved Cookie implementation, more flexible and complete
\&        \- Domain cookie key now works
\&        : Expire times now taken from time(), and relative time in sec
\&        : Request\->Cookies() reading more flexible, with wantarray()
\&          on hash cookie values, %hash = $Request\->Cookie(\*(Aqtest\*(Aq);
\&
\& \-make test module naming correction, was t.pm, now T.pm for Unix
\&
\& +POD / README cleanup, formatting and HTML friendly.
.Ve
.ie n .IP "$VERSION = 0.03; $DATE=""09/14/1998"";" 4
.el .IP "\f(CW$VERSION\fR = 0.03; \f(CW$DATE\fR=``09/14/1998'';" 4
.IX Item "$VERSION = 0.03; $DATE=09/14/1998;"
.Vb 1
\& +Installation \*(Aqmake test\*(Aq now works
\&
\& +ActiveX objects on Win32 implemented with $Server\->CreateObject() 
\&
\& +Cookies implemented: $Response\->Cookies() & $Request\->Cookies()
\&
\& \-Fixed $Response object API, converting some methods to object members.
\&  Deprecated methods, but backwards compatible.
\&
\& +Improved error messaging, debug output
\&
\& +$, influences $Response\->Write(@strings) behavior
\&
\& +perl print() works, sending output to $Response object
\&
\& +$Response\->Write() prints scalars, arrays, and hashes.  Before only scalars.
\&
\& +Begin implementation of $Server object.
\&
\& +Implemented $Response\->{Expires} and $Response\->{ExpiresAbsolute}
\&
\& +Added "PerlSetVar StatINC" config option
\&
\& +$0 is aliased to current script filename
\&
\& +ASP Objects ($Response, etc.) are set in main package
\&  Thus notation like $main::Response\->Write() can be used anywhere.
.Ve
.ie n .IP "$VERSION = 0.02; $DATE=""07/12/1998"";" 4
.el .IP "\f(CW$VERSION\fR = 0.02; \f(CW$DATE\fR=``07/12/1998'';" 4
.IX Item "$VERSION = 0.02; $DATE=07/12/1998;"
.Vb 1
\& ++Session Manager, won\*(Aqt break under denial of service attack
\&
\& +Fleshed out $Response, $Session objects, almost full implementation.
\&
\& +Enormously more documentation.
\&
\& \-Fixed error handling with Debug = 2.
\&
\& \-Documentation fixed for pod2man support.  README now more man\-like.
\&
\& \-Stripped \er\en dos characters from installation files
\&
\& \-755 mode set for session state directory when created
\&
\& \-Loads Win32/OLE properly, won\*(Aqt break with UNIX
.Ve
.ie n .IP "$VERSION = 0.01; $DATE=""06/26/1998"";" 4
.el .IP "\f(CW$VERSION\fR = 0.01; \f(CW$DATE\fR=``06/26/1998'';" 4
.IX Item "$VERSION = 0.01; $DATE=06/26/1998;"
.Vb 4
\& Syntax Support
\& \-\-\-\-\-\-\-\-\-\-\-\-\-\-
\& Initial release, could be considered alpha software.
\& Allows developers to embed perl in html ASP style.
\&
\& 
\& 
\& 
\& <% for(1..10) { %>
\&        counting: <%=$_%> 
\& <% } %> \& \& \& \& ASP Objects \& \-\-\-\-\-\-\-\-\-\-\- \& $Session, $Application, $Response, $Request objects available \& for use in asp pages. \& \& $Session & $Application data is preserved using SDBM files. \& \& $Session id\*(Aqs are tracked through the use of cookies. \& \& Security \& \-\-\-\-\-\-\-\- \& Timeouts any attempt to use a session id that doesn\*(Aqt already \& exist. Should stop hackers, since there is no wire speed guessing \& cookies. .Ve .SH "LICENSE" .IX Header "LICENSE" Copyright (c) 1998\-2018, Josh Chamas .PP All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP Apache::ASP is a perl native port of Active Server Pages for Apache and mod_perl.