in reply to Re: how to deal with error message
in thread how to deal with error message

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.

Replies are listed 'Best First'.
Re^3: how to deal with error message
by Lawliet (Curate) on Jul 22, 2008 at 20:35 UTC

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

    <(^.^-<) <(-^.^<) <(-^.^-)> (>^.^-)> (>-^.^)>
Re^3: how to deal with error message
by Bloodnok (Vicar) on Jul 23, 2008 at 09:56 UTC
    ...or why not,

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

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