Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
In fact try the following variation of the eval and tell me whether it works better

You the monk!

Yes, it does. And, because of your patient explanation, I understand better what is going on. A few questions niggle my mind and remain --

  1. When I convert the warn into a die it gets trapped by eval. Why? I mean, why doesn't die behave the same way as warn... it is, after all, an error, and should be redirected to STDERR. Mind you, the way it is working _is_ how I want it to be. I just don't get this discrimination.
  2. When warn gets piped to STDERR, why does the script stop working? After all, it is just a warn and not a die. I would expect the script to warn and then continue working merrily. I've put it in an infinite loop with a sleep statement in there, so it should just take a breather and then try again. Except, if I don't modify eval as you have suggested above, the warn goes to STDERR and the script quits.
  3. Since the above modification works, it should also work if instead of warn I explicitly use die. In fact, I am going to try that right away and see if it does so. In that case the local modification of SIG{__WARN__} should not be necessary.
  4. And finally, I am assuming I can convert other SIGs the same way. In fact, I don't want the script to die ever unless CTRL-C/BREAK is pressed (SIGINT) or the computer is shutdown. Any caveats to that?
In any case, muchas gracias por su ayuda.

In reply to Re^4: Understanding compiletime vs. runtime by punkish
in thread Understanding compiletime vs. runtime by punkish

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 wandering the Monastery: (3)
As of 2024-04-18 19:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found