I'm tring to get a handle on a bunch of Perlish things, i.e. OO, modules, Class::DBI, namespaces, CPAN, ...

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:

$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'
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.


In reply to Trivial CPAN module? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.