Well Perl OK.
When dealing with Class::DBI I find I do the same things over and over. So I overide the base class methods and do it my way. For example I want Class::DBI to do the following:
What I'm asking is, well ... Do I get it? Or is this increadably dumb? Should I submit it to CPAN and wait for the royalty checks and parades? or is it just tooooo trivial? Its really quite simple - but it seems usefull.$id = $obj->create({id =>999, number_of_days_on_the_job=>3, number_of_people_shot=>12}); $error_string = $id unless $id == 999; # overide default die behavour and # return the error message if it fails constraints # for HTML::Template to 'associate' with $obj->param('number_of_people_shot'); print "The known fields are ".$obj->param()."\n"; %errors = $obj->set( number_of_days_on_the_job => 4, number_of_people_shot => 27); # or more to the point %errors = $obj->set( $CGI->Vars ); # i.e. don't die! also # don't update any of the values if there are any errors. # and collect errors in hash for each error. print $error{number_of_people_shot} if $error{number_of_people_shot} exists; ($dead, $x, $days) = $obj->get( number_of_days_on_the_job, x, number_of_people_shot); # NOTE x is not in the table print $x # prints some nonsense about that it - 'cant get nothing'
In reply to Trivial CPAN module? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |