NAME

PSP::CGI::Info - provides function interface CGI environment variables.


SYNOPSIS

  use PSP::CGI::Info;
  my $clientIP = clientIP();
  my $scriptURI = scriptURI();
  my $requestURI = requestURI();
  my $documentRoot = documentRoot();


DESCRIPTION

This simple module does nothing but providing a nicer interface for working with the most important CGI environment variables. This module was created as a companion to the Perl Script Pages Engine. See the PSP::Engine manpage for more information.


OVERVIEW

Exported Functions

clientIP
Returns the client's IP address, if provided by the web server, in dotted decimals format. See clientIP function for details.

scriptURI
Returns the complete URI requested by the client, if provided by the web server. See scriptURI function for details.

requestURI
Returns the local part of the URI the client requested, if provided by the web server. See requestURI function for details.

documentRoot
Returns the web server's/web virtual host's document root directory, if provided by the web server. See documentRoot function for details.


SYNTAX

clientIP Function

Returns the client's IP address, if provided by the web server, in dotted decimals format.

  use PSP::CGI::Info;
  
  my $clientIP = clientIP();

This function is exported automatically.

Required Parameters

None.

Optional Parameters

None.

Return Values

$clientIP
The client's IP address in dotted decimals format, or undef if not provided by the web server.

scriptURI Function

Returns the complete URI requested by the client, if provided by the web server.

  use PSP::CGI::Info;
  
  my $scriptURI = scriptURI();

This function is exported automatically.

Required Parameters

None.

Optional Parameters

None.

Return Values

$scriptURI
The complete URI requested by the client, i.e. ``http://foo/bar.psp'', or undef if not provided by the web server.

requestURI Function

Returns the local part of the URI the client requested, if provided by the web server.

  use PSP::CGI::Info;
  
  my $requestURI = requestURI();

This function is exported automatically.

Required Parameters

None.

Optional Parameters

None.

Return Values

$requestURI
The local part of he URI requested by the client, i.e. ``/foo/bar.psp'', or undef if not provided by the web server.

documentRoot Function

Returns the web server's/web virtual host's document root directory, if provided by the web server.

  use PSP::CGI::Info;
  
  my $documentRoot = documentRoot();

This function is exported automatically.

Required Parameters

None.

Optional Parameters

None.

Return Values

$documentRoot
The web server's/web virtual host's document root directory, or undef if not provided by the web server.


AUTHOR

Veit Wahlich

E-Mail: cru |at| zodia |dot| de

WWW: http://home.ircnet.de/cru/


VERSION

v0.7 Wednesday, 18 January 2006


COPYRIGHT/LICENSE

Copyright 2004-2006 Veit Wahlich

This software is distributed as free (libre) software under the terms of the GNU General Public License, version 2 <http://www.gnu.org/copyleft/gpl.html>. The author disclaims responsibility of any damage or harm caused directly or indirectly by usage of this software. Use only at your own risk.