I've been looking at Maypole as a possible way to crank out simple tools based on an existing schema. After some initial installation headaches, I can't seem to get a trivial example working.

I'm starting with this perl.com article and the CGI::Maypole perldoc as a basis for my experiement. I created this simple "people" table...

mysql> use test; Database changed mysql> describe people; +-------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------+------+-----+---------+-------+ | it | int(11) | | PRI | 0 | | | name | varchar(255) | YES | | NULL | | | bday | date | YES | | NULL | | +-------+--------------+------+-----+---------+-------+ 3 rows in set (0.00 sec)

...and then i setup this Maypole driver...

package IsfdbMaypole; use strict; use warnings; use lib qw(/home/hossman/.perllib/lib/perl5/site_perl); use base 'CGI::Maypole'; IsfdbMaypole->config->uri_base("http://XXXXXXXXXXX/~hossman/maypole\ /"); IsfdbMaypole->config->display_tables([qw[people]]); IsfdbMaypole->config->rows_per_page(10); IsfdbMaypole->config->user("hossman"); IsfdbMaypole->config->pass("ZZZZZZZZZZZZ"); IsfdbMaypole->setup("dbi:mysql:test"); 1;

...and this index.cgi in my public_html/maypole directory...

#!/usr/bin/perl use strict; use warnings; use lib qw(/home/hossman/.perllib/lib/perl5/site_perl); use IsfdbMaypole; IsfdbMaypole->run();

The problem I'm running into is this...

Can't locate object method "set_db" via package "IsfdbMaypole::People" + at /home/hossman/.perllib/lib/perl5/site_perl/5.8.5/Class/DBI/Loader +/Generic.pm line 173. Compilation failed in require at /home/hossman/public_html/maypole/ind +ex.cgi line 5. BEGIN failed--compilation aborted at /home/hossman/public_html/maypole +/index.cgi line 5.

what is the "set_db" method and why does Class::DBI::Loader::Generic think it needs to be called? Has anyone encountered this error before? Did I do something wrong?


In reply to trying out Maypole: Class::DBI::Loader calling set_db? by hossman

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.