Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Carp not working after change to objects

by cosmicperl (Chaplain)
on May 16, 2008 at 14:03 UTC ( #686921=note: print w/replies, xml ) Need Help??


in reply to Re: Carp not working after change to objects
in thread Carp not working after change to objects

Thanks for the reply, but I'm pretty sure that's not it. I want DBI to just give me a warning, it's my own code that does a Croak. (I don't want to croak in all situations of a DBI's carp).
  • Comment on Re^2: Carp not working after change to objects

Replies are listed 'Best First'.
Re^3: Carp not working after change to objects
by snoopy (Deacon) on May 17, 2008 at 02:12 UTC
    Sorry this didn't help.

    Btw, I'm not able exactly replicate your error with my Sqlite driver. My prepare statement on an unknown table returns undef, not a valid statement handle.

    my $sth = $dbh1->prepare("insert into guff values (1,2,3)") or croak "prepare error" # dies here for me

    If you're not raising errors, be aware that prepare may return undef.

    Also consider localisd error handling. You still has the option of dieing or continuing:

    my $dbh = DBI->connect(... ,{RaiseError => 1}); do { local $SIG{__ERROR__} = \&my_handler; # database code }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://686921]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2018-07-21 00:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (442 votes). Check out past polls.

    Notices?