Eidolon::Core::CGI - common gateway interface functions for Eidolon.
use Eidolon::Core::CGI;
The Eidolon::Core::CGI class provides standard CGI functions - GET/POST requests parsing, cookies & session handling. It's more comfortable and fast replacement of old CGI package.
Class constructor. Creates an object and calls the initialization function.
Decodes an url-encoded $string.
$string
Returns a value of the GET parameter. If $name of variable is not given, returns a hashref with all GET parameters.
$name
Returns a value of the POST parameter. If $name of variable is not given, returns a hashref with all POST parameters.
Returns a cleaned query string.
Returns a hashref with uploaded file data:
name
Uploaded file name.
tmp
Path to temporary file, where uploaded file contents are stored. This file is automatically deleted during Eidolon::Core::CGI object destruction, so you don't need to care about this.
ext
Uploaded file extension.
If $name of parameter is not given, returns a hashref with all uploaded files.
Returns contents of the uploaded file. $name - name of upload variable.
Returns a value of the GET or POST parameter with the given $name. If variable $name exists both in GET and POST requests, value will be taken from first.
Returns a cookie value.
Sets a cookie. $expires - is a number of seconds in which the cookie will be expired.
$expires
Returns a randomly-generated string with. $len - length of the string to be generated. If $len is not specified, 32-character string will be generated.
$len
Initialize user session. Generates a magic session ID and sets a cookie with this value to user.
Destroys the session, if any.
Checks if session was started.
Sets session parameter $key with the given $value.
$key
$value
Returns $key session parameter value.
Checks if HTTP header is already sent. Returns 1 or 0.
Adds user-defined header string $header.
$header
Sends a redirect header to web browser.
Sends HTTP header to browser.
Eidolon, CGI
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Anton Belousov, <abel@cpan.org>
Copyright (c) 2009, Atma 7, http://www.atma7.com
To install Eidolon, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Eidolon
CPAN shell
perl -MCPAN -e shell install Eidolon
For more information on module installation, please visit the detailed CPAN module installation guide.