Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
A i see what you mean now by 'testing a croak without die'.
BrowserUk is right, but i do not like it, for 2 reasons.

1. I don't like eval.
Eval creates major security issues if improper used. (and that happens fast). But you're using it for testing, so that won't probably stop you here.
2. I don't like die
A script that dies with an error is not my kind of taste. I'd better like to use carp or cluck, and give a warning to the user, but definately not die. (Especially for webbased applications, where they give nasty server-errors)

*Update* I really don't understand the 'big' discussion that comes up now. I never stated that i BrowserUk was wrong, i said he is right.
I only stated that i (me myself and i), don't like it, that is not stating that i never use it, or that it should not be used at all.
I gave 2 reasons (you can agree with or not) why, and IMHO, correct reasons.
I mainly work in web applications, most of the time a simple warn is enough to create the proper logs i need.
Next, the use of eval can be dangerous, that's what i point out, not that it allways is, and yes i use eval as well.

Next, i NEVER EVER stated that my programs are perfect (in fact, they're far from perfect, like most programs are).

I've got a slight feeling here that there is a bit overreacting here on something that was stated as my own opinion.
"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.

In reply to Re^2: testing a croak by jbrugger
in thread testing a croak by arcnon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2024-04-18 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found