-
Notifications
You must be signed in to change notification settings - Fork 1
ClassCGI
Anthony Johnson edited this page May 16, 2013
·
1 revision
Update: this module is Now on the CPAN and has a mailing list. Feel free to join and contribute.
The following is a description of a module I (Ovid) keep meaning to write, but don't. Anyone want to tackle it?
Class::CGI
-- Use CGI parameters as objects
use Class::CGI (
customer_id => Class::CGI::Customer
);
my $cgi = Class::CGI->new;
my $customer = $cgi->param('customer_id');
my $name = $customer->name;
For small CGI scripts, it's still 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 (subclassing would not be appropriate) which could take the parameter value, automatically perform those steps and just return the object. Much grunt work would just go away.