Help needed with pg.pm to connect to postgresql

From: Kisala Muhavi <ayuma(at)email(dot)com>
To: pgsql-general(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org
Subject: Help needed with pg.pm to connect to postgresql
Date: 2000-11-04 14:40:51
Message-ID: 383762072.973348855722.JavaMail.root@web277-ec
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

hi,
Im using linux and i have postgresql 6.5 and perl 5.003 installed on system.
Im having problems connecting to postgresql where as ive pgsql_perl5
installed, only that im not sure whether its configured propely. well this
is the error i incur whenever i try to run my program :-

"can't locate pg.pm in @INC(@INC contains :/usr/lib/perl5/5.00503/i386-linux
/usr/lib/perl5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux
/usr/lib/perl5/site_perl/5.005.) at connect.cgi
BEGIN failed --compilation aborted at connect.cgi "

well this my short perl program:

#!/usr/local/bin/perl
#
#perl sample program

use pg;

$conn =pg::connectdb("dbname=test");
die $conn->errorMessage unless PGRES_CONNECTION_OK eq $conn->status;

print "Enter User name :"
$username = <STDIN>;
chomp $username;

$result = $conn->exec(
"SELECT firstname,lastname,state,city,age from friends WHERE firstname =
'username'");

die $conn->errorMessage unless PGRES_TUPLES_OK eq $result->resultstatus;

while (@row = $result->fetchrow)
{
print @row, "\n";
}

please help.
thanks bye
Bonface Kisala.

-----------------------------------------------
FREE! The World's Best Email Address @email.com
Reserve your name now at http://www.email.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Gould 2000-11-04 15:49:04 Re: question on SELECT using LIKE
Previous Message mgainty 2000-11-04 13:37:58 Re: What makes a Postgres DBA?

Browse pgsql-novice by date

  From Date Subject
Next Message Jesus Aneiros 2000-11-05 14:44:27 Re: [NOVICE] Help needed with pg.pm to connect to postgresql
Previous Message Larry Rosenman 2000-11-03 19:21:53 Re: PgSQL question