Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: how to deal with error message

by AltBlue (Chaplain)
on Jul 22, 2008 at 20:26 UTC ( [id://699416]=note: print w/replies, xml ) Need Help??


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 :-))

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://699416]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-24 21:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found