On 3/16/07, Jasbinder Singh Bali <[EMAIL PROTECTED]> 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
you dont need to put ->connect in eval.
just set connect option 'raiseerror' to 0 (and printerror as
> "Douglas" == Douglas McNaught <[EMAIL PROTECTED]> writes:
Douglas> my $dbh;
Douglas> eval { $dbh = connect(...) };
Since eval returns its value (or undef if $@ has the error), you can shorten
this to:
my $dbh = eval { DBI->connect(...) };
and now either look at $@ (if you want to disting
"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 used>
The my() variable goes ou
On Fri, Mar 16, 2007 at 10:54:49AM -0400, 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 is used>
Wel
esql.org
Subject: Re: [GENERAL] exception handling in plperlu
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
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 ever dbh is used>
There is a ma
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
Jas
On 3/16/07, Martijn van Oosterhout wrote:
On Thu, Mar 15, 2007 at 10:06:06PM -0400, Jas
On Thu, Mar 15, 2007 at 10:06:06PM -0400, Jasbinder Singh Bali wrote:
> How about using a try catch block?
> isn't that more efficient that eval?
Umm, eval is perl's equivalent of try/catch. There is no other way.
Have a nice day,
--
Martijn van Oosterhout http://svana.org/kleptog/
> From e
How about using a try catch block?
isn't that more efficient that eval?
~Jas
On 3/15/07, Tom Lane <[EMAIL PROTECTED]> wrote:
"Jasbinder Singh Bali" <[EMAIL PROTECTED]> writes:
> Actually, if I rephrase my requirement, I need to catch an exception at
any
> point ,where ever it is raised, in th
"Jasbinder Singh Bali" <[EMAIL PROTECTED]> writes:
> Actually, if I rephrase my requirement, I need to catch an exception at any
> point ,where ever it is raised, in the perl code.
> E.g during an insert, there is a foreign key contraint violation, then i
> need to catch this specific error and do
10 matches
Mail list logo