Re: exception handling in plperlu - Mailing list pgsql-general

From A.M.
Subject Re: exception handling in plperlu
Date
Msg-id 8D7DE746-7E8A-40D3-B71F-222B14696CA0@themactionfaction.com
Whole thread Raw
In response to Re: exception handling in plperlu  ("Jasbinder Singh Bali" <jsbali@gmail.com>)
List pgsql-general

On Mar 16, 2007, at 10:54 , Jasbinder Singh Bali wrote:

just wondeng why doesn't it let me put
my $dbh=DBI->connect("dbi:Pg:dbname=dbunmask; host=192.168.0.120; port=5432;", "", "");
in eval

says
Global symbol "$dbh" requires explicit package name at line <where ever dbh is used>


There is a mailing list for DBD::Pg:

But your problem in not related to the driver, rather it's a Perl issue. Your variable is defined within the block, so its scope is the eval block ("my" implies lexical scoping). If you define it outside the block and assign inside the block, then it will work.

Cheers,
M

pgsql-general by date:

Previous
From: "Robin Ericsson"
Date:
Subject: Re: simple coordinate system
Next
From: "Adam Rich"
Date:
Subject: Re: exception handling in plperlu