http://www.perlmonks.org?node_id=541996


in reply to Re: RFC: Class::CGI
in thread RFC: Class::CGI

I've just finished updating the code to handle all of this. Here's an example from the docs:

package My::Date::Handler; use My::Date; sub new { my ($class, $cgi) = @_; my $month = $cgi->raw_param('month'); my $day = $cgi->raw_param('day'); my $year = $cgi->raw_param('year'); return My::Date->new( month => $month, day => $day, year => $year, ); } 1;

And in the user's code:

use Class::CGI handlers => { date => 'My::Date::Handler', }; my $cgi = Class::CGI->new; my $date = $cgi->param('date'); my $day = $date->day;

It's not uploaded anywhere yet, though. I'll wait for more suggestions. I must say, it's really nice to see how clean design of classes makes extending them so easy :)

Cheers,
Ovid

New address of my CGI Course.