Hi All,
"Plan to throw one away" (see *The Mythical Man-Month* by Brooks), indeed: I've just about finished a more-complex
than-I-thought web + database application and then too late thought "gosh, nice if there were something like Hibertnate
for Perl." A quick web search led me to Class::DBI, which looks like it will eliminate 75% of the code I just wrote, and
good riddance to it since I have to maintain the thing ongoing.
It does reduce a lot of code, but as you've seen, it has it's own quirks... Maybe that's why we love it so much :)
BUT ... I have a small example working as a standalone Perl script but can't get it going inside mod_perl. I have a startup.pl
script running successfully:
I don't know if it addresses the specific issue you are having, but there is a wiki page just for running C::D under mod_perl.
http://www.class-dbi.com/cgi-bin/wiki/index.cgi?UsingWithModPerl
If you aren't having some of these issues now, you soon will be, so at least I have lent a hand on your next problem :)
use lib qw(/usr/local/apache2/perl); use Class::DBI; use Class::DBI::Pg; use inforce; 1;
And the 'inforce' module is just simply:
#!/usr/bin/perl
use strict; use base qw(Class::DBI::Pg);
__PACKAGE__->set_db(Main => 'dbi:Pg:dbname=etracclass', 'nobody', ''); __PACKAGE__->set_up_table('inforce');
1;
But I can't get my Apache::ASP page to recognize it with any combination of
use inforce;
with or without the other classes above in 'startup.pl'. I get Can't's locate object method "search" via package 'inforce' ...
Obviously this is something simple -- thanks in advance for any guidance whatsoever
on this.
HTH a little.
-- Michael Peters Developer Plus Three, LP