In a CGI if you do:

die "Bugger!\n";

then the user will not get an error message. Typically they will get a 500 internal server error or a blank screen, depending on if a header has been output. They will not see the error message. A die nice routine might be:

# sack the QA team! sub die_nice { my ( $real_error ) = @_; email( $ADMIN, $real error ); warn $real_error; # this will log it like die # Make sure we have a valid header.... print "Content-Type: text/html\n\n"; # Lie to the user, we don't want to let them know our code is unst +able now do we? print " <p>Sorry the server is unable to respond to your request due to routin +e maintenance <p>Please try again later...."; # yeah right..... exit 1; }

So rather than die-ing you die nice ie do some stuff you want. You could just set a DIE handler but.....

cheers

tachyon


In reply to Re: What is dienice??? by tachyon
in thread What is dienice??? by Anonymous Monk

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.