Class::CGI 0.20 review
DownloadClass::CGI is a Perl module to fetch objects from your CGI object. SYNOPSIS use Class::CGI handlers => {
|
|
Class::CGI is a Perl module to fetch objects from your CGI object.
SYNOPSIS
use Class::CGI
handlers => {
customer_id => 'My::Customer::Handler'
};
my $cgi = Class::CGI->new;
my $customer = $cgi->param('customer_id');
my $name = $customer->name;
my $email = $cgi->param('email'); # behaves like normal
if ( my %errors = $cgi->errors ) {
# do error handling
}
For small CGI scripts, it's common to get a parameter, untaint it, pass it to an object constructor and get the object back. This module would allow one to to build Class::CGI handler classes which take the parameter value, automatically perform those steps and just return the object. Much grunt work goes away and you can get back to merely pretending to work.
Requirements:
Perl
Class::CGI 0.20 keywords