Don't hide errors. Use use strict; and use warnings;.
user=postgres
should be
'postgres'
As is, it means
'user' = 'postgres'
and it doesn't make sense to assign to a constant string.
You have an argument missing. While the option hash is optional, the password isn't. It must appear between the user name and the option hash, even if it's only ''.
I don't think quotes are allowed around the dbname. They're definitely not needed.
"DBI:Pg:dbname='five'; port=5432"
should be
"DBI:Pg:dbname=five;port=5432"
... or just
"DBI:Pg:dbname=five"
since port 5432 is the default.
Update: Added last two bullets.
In reply to Re: connect database
by ikegami
in thread connect database
by Bass-Fighter
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |