CGI::Simple 0.079
Sponsored Links
CGI::Simple 0.079 Ranking & Summary
File size:
0.083 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
960
Date added:
2007-03-08
Publisher:
Andy Armstrong
CGI::Simple 0.079 description
CGI::Simple is a simple totally OO CGI interface that is CGI.pm compliant.
SYNOPSIS
use CGI::Simple;
$CGI::Simple::POST_MAX = 1024; # max upload via post default 100kB
$CGI::Simple::DISABLE_UPLOADS = 0; # enable uploads
$q = new CGI::Simple;
$q = new CGI::Simple( { foo=>1, bar=>[2,3,4] } );
$q = new CGI::Simple( foo=1&bar=2&bar=3&bar=4 );
$q = new CGI::Simple( *FILEHANDLE );
$q->save( *FILEHANDLE ); # save current object to a file as used by new
@params = $q->param; # return all param names as a list
$value = $q->param(foo); # return the first value supplied for foo
@values = $q->param(foo); # return all values supplied for foo
%fields = $q->Vars; # returns untied key value pair hash
$hash_ref = $q->Vars; # or as a hash ref
%fields = $q->Vars("|"); # packs multiple values with "|" rather than " ";
@keywords = $q->keywords; # return all keywords as a list
$q->param( foo, some, new, values ); # set new foo values
$q->param( -name=>foo, -value=>bar );
$q->param( -name=>foo, -value=>[bar,baz] );
$q->param( foo, some, new, values ); # append values to foo
$q->append( -name=>foo, -value=>bar );
$q->append( -name=>foo, -value=>[some, new, values] );
$q->delete(foo); # delete param foo and all its values
$q->delete_all; # delete everything
$files = $q->upload() # number of files uploaded
@files = $q->upload(); # names of all uploaded files
$filename = $q->param(upload_file) # filename of uploaded file
$mime = $q->upload_info($filename,mime); # MIME type of uploaded file
$size = $q->upload_info($filename,size); # size of uploaded file
my $fh = $q->upload($filename); # get filehandle to read from
while ( read( $fh, $buffer, 1024 ) ) { ... }
# short and sweet upload
$ok = $q->upload( $q->param(upload_file), /path/to/write/file.name );
print "Uploaded ".$q->param(upload_file)." and wrote it OK!" if $ok;
$decoded = $q->url_decode($encoded);
$encoded = $q->url_encode($unencoded);
$escaped = $q->escapeHTML(<>"&);
$unescaped = $q->unescapeHTML(<>"&);
$qs = $q->query_string; # get all data in $q as a query string OK for GET
$q->no_cache(1); # set Pragma: no-cache + expires
print $q->header(); # print a simple header
# get a complex header
$header = $q->header( -type => image/gif
-nph => 1,
-status => 402 Payment required,
-expires =>+24h,
-cookie => $cookie,
-charset => utf-7,
-attachment => foo.gif,
-Cost => $2.00
);
# a p3p header (OK for redirect use as well)
$header = $q->header( -p3p => policyref="http://somesite.com/P3P/PolicyReferences.xml );
@cookies = $q->cookie(); # get names of all available cookies
$value = $q->cookie(foo) # get first value of cookie foo
@value = $q->cookie(foo) # get all values of cookie foo
# get a cookie formatted for header() method
$cookie = $q->cookie( -name => Password,
-values => [superuser,god,my dog woofie],
-expires => +3d,
-domain => .nowhere.com,
-path => /cgi-bin/database,
-secure => 1
);
print $q->header( -cookie=>$cookie ); # set cookie
print $q->redirect(http://go.away.now); # print a redirect header
dienice( $q->cgi_error ) if $q->cgi_error;
CGI::Simple provides a relatively lightweight drop in replacement for CGI.pm. It shares an identical OO interface to CGI.pm for parameter parsing, file upload, cookie handling and header generation. This module is entirely object oriented, however a complete functional interface is available by using the CGI::Simple::Standard module.
Essentially everything in CGI.pm that relates to the CGI (not HTML) side of things is available. There are even a few new methods and additions to old ones! If you are interested in what has gone on under the hood see the Compatibility with CGI.pm section at the end.
In practical testing this module loads and runs about twice as fast as CGI.pm depending on the precise task.
SYNOPSIS
use CGI::Simple;
$CGI::Simple::POST_MAX = 1024; # max upload via post default 100kB
$CGI::Simple::DISABLE_UPLOADS = 0; # enable uploads
$q = new CGI::Simple;
$q = new CGI::Simple( { foo=>1, bar=>[2,3,4] } );
$q = new CGI::Simple( foo=1&bar=2&bar=3&bar=4 );
$q = new CGI::Simple( *FILEHANDLE );
$q->save( *FILEHANDLE ); # save current object to a file as used by new
@params = $q->param; # return all param names as a list
$value = $q->param(foo); # return the first value supplied for foo
@values = $q->param(foo); # return all values supplied for foo
%fields = $q->Vars; # returns untied key value pair hash
$hash_ref = $q->Vars; # or as a hash ref
%fields = $q->Vars("|"); # packs multiple values with "|" rather than " ";
@keywords = $q->keywords; # return all keywords as a list
$q->param( foo, some, new, values ); # set new foo values
$q->param( -name=>foo, -value=>bar );
$q->param( -name=>foo, -value=>[bar,baz] );
$q->param( foo, some, new, values ); # append values to foo
$q->append( -name=>foo, -value=>bar );
$q->append( -name=>foo, -value=>[some, new, values] );
$q->delete(foo); # delete param foo and all its values
$q->delete_all; # delete everything
$files = $q->upload() # number of files uploaded
@files = $q->upload(); # names of all uploaded files
$filename = $q->param(upload_file) # filename of uploaded file
$mime = $q->upload_info($filename,mime); # MIME type of uploaded file
$size = $q->upload_info($filename,size); # size of uploaded file
my $fh = $q->upload($filename); # get filehandle to read from
while ( read( $fh, $buffer, 1024 ) ) { ... }
# short and sweet upload
$ok = $q->upload( $q->param(upload_file), /path/to/write/file.name );
print "Uploaded ".$q->param(upload_file)." and wrote it OK!" if $ok;
$decoded = $q->url_decode($encoded);
$encoded = $q->url_encode($unencoded);
$escaped = $q->escapeHTML(<>"&);
$unescaped = $q->unescapeHTML(<>"&);
$qs = $q->query_string; # get all data in $q as a query string OK for GET
$q->no_cache(1); # set Pragma: no-cache + expires
print $q->header(); # print a simple header
# get a complex header
$header = $q->header( -type => image/gif
-nph => 1,
-status => 402 Payment required,
-expires =>+24h,
-cookie => $cookie,
-charset => utf-7,
-attachment => foo.gif,
-Cost => $2.00
);
# a p3p header (OK for redirect use as well)
$header = $q->header( -p3p => policyref="http://somesite.com/P3P/PolicyReferences.xml );
@cookies = $q->cookie(); # get names of all available cookies
$value = $q->cookie(foo) # get first value of cookie foo
@value = $q->cookie(foo) # get all values of cookie foo
# get a cookie formatted for header() method
$cookie = $q->cookie( -name => Password,
-values => [superuser,god,my dog woofie],
-expires => +3d,
-domain => .nowhere.com,
-path => /cgi-bin/database,
-secure => 1
);
print $q->header( -cookie=>$cookie ); # set cookie
print $q->redirect(http://go.away.now); # print a redirect header
dienice( $q->cgi_error ) if $q->cgi_error;
CGI::Simple provides a relatively lightweight drop in replacement for CGI.pm. It shares an identical OO interface to CGI.pm for parameter parsing, file upload, cookie handling and header generation. This module is entirely object oriented, however a complete functional interface is available by using the CGI::Simple::Standard module.
Essentially everything in CGI.pm that relates to the CGI (not HTML) side of things is available. There are even a few new methods and additions to old ones! If you are interested in what has gone on under the hood see the Compatibility with CGI.pm section at the end.
In practical testing this module loads and runs about twice as fast as CGI.pm depending on the precise task.
CGI::Simple 0.079 Screenshot
CGI::Simple 0.079 Keywords
CGI
CGI.pm
OO
Simple 0.079
OO CGI
cgi interface
Foo
header
param
cookie
upload
values
CGI::Simple
CGISimple
CGI::Simple 0.079
Libraries
Bookmark CGI::Simple 0.079
CGI::Simple 0.079 Copyright
WareSeeker periodically updates pricing and software information of CGI::Simple 0.079 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of CGI::Simple 0.079 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
CGI::WML is a Perl module with subclass LDSs CGI.pm for WML output and WML methods. Free Download
CGI::Utils is a Perl module for retrieving information through the Common Gateway Interface and mod_perl. Free Download
CGI::FastTemplate is a Perl extension for managing templates, and performing variable interpolation. Free Download
CGI::Explorer is a class to manage displaying a hash tree of data, for use in CGI scripts. Free Download
CGI:IRC is a Perl/CGI program that allows you to use IRC from a Web browser. Free Download
XML::Writer::Simple is a Perl module to create XML files easily! Free Download
CGI::XMLForm is a Perl extension of CGI.pm which reads/generates formated XML. Free Download
CGI::Test is a CGI regression test framework. Free Download
Latest Software
Popular Software
Favourite Software