Vmail.cgi and PostgreSQL

Hello, i have a problem using the vmail.cgi script with Asterisk using PostgreSQL realtime.

When i try to login, the vmail.cgi script tells me this error:

Can’t call method “prepare” on an undefined value at /var/www/cgi-bin/vmail.cgi line 179, line 17.

I didn’t find what is the problem (i’m not good in perl :stuck_out_tongue:).
Line 178 & 179 are:

my $dbh = DBI->connect(“DBI:Pg:$dbname:$dbhost”,$dbuser,$dbpass);
my $sth = $dbh->prepare(qq{SELECT fullname,context FROM voicemail_conf WHERE mailbox=’$mbox’ and password=’$pass’ and context=’$context’});

I even tried to replace the $mbox/$pass/$context by the value of a mailbox, it still tells me there’s an undefined value. Can anyone help me?

I’ve replaced every occurence of DBI:mysql by DBI:Pg so it uses the PG module to connect to the Postgre server.