Re: Class::DBI + mod_perl? "Can't locate object method 'search' ...

[prev] [thread] [next] [Date index for 2005/04/11]

From: David J Radunz
Subject: Re: Class::DBI + mod_perl? "Can't locate object method 'search' ...
Date: 00:53 on 11 Apr 2005
On Sat, 2005-04-09 at 14:35 -0700, Mark McWiggins wrote:
> Hi All,
>=20
> "Plan to throw one away" (see *The Mythical Man-Month* by Brooks),=20
> indeed: I've just about finished a more-complex
> than-I-thought web + database application and then too late thought=20
> "gosh, nice if there were something like Hibertnate
> for Perl." A quick web search led me to Class::DBI, which looks like =
it=20
> will eliminate 75% of the code I just wrote, and
> good riddance to it since I have to maintain the thing ongoing.
>=20
> 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:
>=20
> > use lib qw(/usr/local/apache2/perl);
> > use Class::DBI;
> > use Class::DBI::Pg;
> > use inforce;
> > 1;
>=20
>=20
> And the 'inforce' module is just simply:
>=20
> > #!/usr/bin/perl
> >
> > use strict;
> > use base qw(Class::DBI::Pg);
> >
> > __PACKAGE__->set_db(Main =3D> 'dbi:Pg:dbname=3Detracclass', =
'nobody', '');
> > __PACKAGE__->set_up_table('inforce');
> >
> > 1;
> >
>=20

why doesn't inforce have a package declaration?

i.e.  package inforce;

and you dont need #!/usr/bin/perl at the top for modules.

Also, why isnt 'inforce.pm' loading the Class DBI modules instead of the
startup.pl script..

We have Class::DBI working fine under mod_perl - I think its just your
implementation that needs refinement :)


> But I can't get my Apache::ASP page to recognize it with any =
combination of
>=20
>     use inforce;
>=20
> with or without the other classes above in 'startup.pl'. I get
>   =20
>     Can't's locate object method "search" via package 'inforce' ...
>=20
> Obviously this is something simple -- thanks in advance for any =
guidance=20
> whatsoever
> on this.
>=20

This email and any files transmitted with it are confidential and =
intended solely for the=20
use of the individual or entity to whom they are addressed. Please =
notify the sender=20
immediately by email if you have received this email by mistake and =
delete this email=20
from your system. Please note that any views or opinions presented in =
this email are solely
 those of the author and do not necessarily represent those of the =
organisation.=20
Finally, the recipient should check this email and any attachments for =
the presence of=20
viruses. The organisation accepts no liability for any damage caused by =
any virus=20
transmitted by this email.=20

Re: Class::DBI + mod_perl? "Can't locate object method 'search' ...
David J Radunz 00:53 on 11 Apr 2005

Generated at 14:43 on 11 Apr 2005 by mariachi v0.52