Re: Yet another DBD::Pg problem

From: David Wheeler <david(at)kineticode(dot)com>
To: josh(at)agliodbs(dot)com
Cc: SF Postgres <sfpug(at)postgresql(dot)org>
Subject: Re: Yet another DBD::Pg problem
Date: 2003-11-14 23:18:50
Message-ID: E7F0D5DE-16F8-11D8-9545-0003931A964A@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: sfpug

On Friday, November 14, 2003, at 12:12 AM, Josh Berkus wrote:

> Anyone get the feeling we should start a pgsql-perl mailing list?

dbdpg-general(at)gborg(dot)postgresql(dot)org is actually pretty good.

> I've been getting off and on a bizarre problem were database handles
> defined
> in the main program can't be used in subs. I get a:
>
> Can't call method "prepare" on an undefined value at elbs_text_xfer.pl
> line
> 410
>
> Is this a known issue with earlier versions of DBD::pg? Something in
> my
> sloppy perl programming? Hints?

I got this a long time ago when I was doing my own database handle
caching in mod_perl and keeping the handle in a file-scoped lexical
variable. It went away when I switched to a global variable (that is,
used our() instead of my()).

A much better solution that I adopted for Bricolage 1.6.6 or
thereabouts was to use DBI->connect-cached() and let DBI worry about it.

HTH,

David

--
David Wheeler AIM: dwTheory
david(at)kineticode(dot)com ICQ: 15726394
http://www.kineticode.com/ Yahoo!: dew7e
Jabber: Theory(at)jabber(dot)org
Kineticode. Setting knowledge in motion.[sm]

In response to

Browse sfpug by date

  From Date Subject
Next Message Josh Berkus 2003-11-14 23:39:20 Re: Meeting? November/December
Previous Message Josh Berkus 2003-11-14 20:22:44 Still trying to fill our office ....