http://qs321.pair.com?node_id=423621

hossman has asked for the wisdom of the Perl Monks concerning the following question:

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?