I have been using zope for a while and while it is cool, I really like the
speed/power/ease-of-use of perl so I would like to mimick some of the more
important functions I saw in zope and I can't figure it out.

One of the cool zope things was that you made one db connection object and then
all database interaction referenced that connection object. If you had to change
the connection string, it was in one place.

How can I do something like that in modperl? I am thinking I should be able to
just create a one-line connection string in a a file at the base of a site, and
then include that file in all perl pages. That takes care of the one place to
change it problem, but I am not getting it.

Something like
con.txt
my $dbh ||= DBI->connect("dbi:Oracle:host=red.home.com;sid=RED", 'scott',
'tiger') || die "Can't connect to : DBI->errstr";

and then in the cgi file say somthing like:
include(con.txt)

There must be an easy way to do this!

Thanks


Reply via email to