in reply to (jeffa) Re: Script does not die when DB connection fails
in thread Script does not die when DB connection fails

Probably a silly question but I get the following now 'Can't get task ID: DBI::db=HASH(0x355bf4)->errstr' when I use $dbh->errstr, I assumed I'd get an error message?
  • Comment on Re: (jeffa) Re: Script does not die when DB connection fails

Replies are listed 'Best First'.
Re: Re: (jeffa) Re: Script does not die when DB connection fails
by davorg (Chancellor) on May 25, 2001 at 18:36 UTC

    $dbh->errstr is a function call. You can't put it in a quoted string.

    Update: arturo asks me to point out that you can interpolate function calls in quoted strings by doing something nasty and kludgy like:

    "@{ [ $dbh->errstr ] }" --
    <http://www.dave.org.uk>

    "Perl makes the fun jobs fun
    and the boring jobs bearable" - me

      How do I get a meaningful error message returned from this function ? By the way thanks for all the help so far.
      Thanks for that. All is working now.