in reply to how to deal with error message

Instead of having it die, simply have it call a subroutine that sends you the email, then exit.

my $dbh = DBI->connect('DBI:Oracle:host=**,sid=***', 'usrname', 'passw +d', { RaiseError => 1, AutoCommit => 0 } ) or sendmail(); sub sendmail { ... #Send mail here die; }

Update: Or, instead of having the die command in your subroutine (which may be troublesome if you plan to call the subroutine more than once) you can use or sendmail() and die; rather than just sendmail();

<(^.^-<) <(-^.^<) <(-^.^-)> (>^.^-)> (>-^.^)>

Replies are listed 'Best First'.
Re^2: how to deal with error message
by AltBlue (Chaplain) on Jul 22, 2008 at 20:26 UTC
    Update: Or, instead of having the die command in your subroutine (which may be troublesome if you plan to call the subroutine more than once) you can use or sendmail() and die; rather than just sendmail();

    DBI->connect(...) or sendmail() and die; would mean to die whenever the connection is successful ;-)

    I guess you meant DBI->connect(...) or do { sendmail(); die; };. :)

    --
    altblue.

      Oh, would it? Thanks for correction; that is what I meant.

      <(^.^-<) <(-^.^<) <(-^.^-)> (>^.^-)> (>-^.^)>
      ...or why not,

      sendmail(), die unless DBI->connect(...)

      At last, a user level that overstates my experience :-))