"Jasbinder Singh Bali" <[EMAIL PROTECTED]> writes:
> 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>
The my() variable goes out of scope when the eval {} is done. Declare
the variable outside the eval {}:
my $dbh;
eval { $dbh = connect(...) };
eval { $dbh->prepare(...:) };
-Doug
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq