This has been reformatted for easier use!
Hello all,
I have some PostgreSQL/Perl problems.
I am using RedHat Linux 7.0 with Apache.
I wrote a test script to see if I could connect to my local
Postgres database but it didn't work. When I looked at the
error log it said
"DBI.pm" cannot be found
referring to "use DBI;" in my code.
I was under the impression that Perl had native support for
Postgres so I tried connecting without use DBI; using:
$dbh = DBI->connect("dbi:Pg:dbname=name","user","password");
but an error was caused and the error log said:
Cannot find method "connect" in module "DBI"
Does this mean that Perl has native support for Postgres
but I'm using the wrong method to connect?
If not, do I need to install DBI.pm? Where do I install it?
Any help would be greatly appreciated.
D.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.