Search Postgresql Archives

Re: exception handling in plperlu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Jasbinder Singh Bali" <jsbali@xxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux