in reply to Problem of scope : $SIG{__WARN__} in a module...

Um, why are you using signals? Why not wrap all of your DBI code in a big eval and then deal with $@ if $@ exists (setting the handle's RaiseError when you connect first).
  • Comment on Re: Problem of scope : $SIG{__WARN__} in a module...

Replies are listed 'Best First'.
Re^2: Problem of scope : $SIG{__WARN__} in a module...
by wazoox (Prior) on Dec 07, 2004 at 10:55 UTC
    That's a nice idea, but won't it somewhat slow down everything? I'll give it a try.
      Depends on the eval :-) string eval -> slow, block eval -> as fast as any other perl snippet

      Using eval of a block is the recommendation in the DBI documentation:

      The recommended way to implement robust transactions in Perl applications is to use RaiseError and eval { ... } (which is very fast, unlike eval "...").