NAME CGI::Utils - Utilities for retrieving information through the Common Gateway Interface SYNOPSIS use CGI::Utils; my $utils = CGI::Utils->new; DESCRIPTION This module provides an object-oriented interface for retrieving information provided by the Common Gateway Interface, as well as url-encoding and decoding values. For example, CGI has a utility for escaping HTML, but no public interface for url-encoding a value or for taking a hash of values and returning a url-encoded query string suitable for passing to a CGI script. This module does that, as well as provide methods for creating a self-referencing url, converting relative urls to absolute, adding CGI parameters to the end of a url, etc. Please see the METHODS section below for more detailed descriptions of functionality provided by this module. METHODS urlEncode($str) Returns the fully URL-encoded version of the given string. It does not convert space characters to '+' characters. urlDecode($url_encoced_str) Returns the decoded version of the given URL-encoded string. urlEncodeVars($var_hash, $sep) Takes a hash of name/value pairs and returns a fully URL-encoded query string suitable for passing in a URL. By default, uses the newer separator, a semicolon, as recommended by the W3C. If you pass in a second argument, it is used as the separator between key/value pairs. urlDecodeVars($query_string) Takes a URL-encoded query string, decodes it, and returns a reference to a hash of name/value pairs. For multivalued fields, the value is an array of values. getSelfRefHostUrl() Returns a url referencing top level directory in the current domain, e.g., http://mydomain.com getSelfRefUrl() Returns a url referencing the current script (without any query string). getSelfRefUrlWithQuery() Returns a url referencing the current script along with any query string parameters passed via a GET method. getSelfRefUrlDir() Returns a url referencing the directory part of the current url. addParamsToUrl($url, $param_hash) Takes a url and reference to a hash of parameters to be added onto the url as a query string and returns a url with those parameters. It checks whether or not the url already contains a query string and modifies it accordingly. If you want to add a multivalued parameter, pass it as a reference to an array containing all the values. getParsedCookies() Parses the cookies passed to the server. Returns a hash of key/value pairs representing the cookie names and values. AUTHOR Don Owens COPYRIGHT Copyright (c) 2003 Don Owens All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. VERSION 0.01