For errors that occur after you've already spit out the header, you can write a custom handling routine (e.g. use or bail_gracefully($!) instead of die, and have bail_gracefully do whatever needs doin' with $!.)
Most HTTP servers have a facility for generating custom error pages -- you can even set up a CGI to handle them. So read up on your webserver's documentation. Under Apache, it can be as simple as adding the line
ErrorDocument 500 /cgi-bin/error_handler.pl
Which says "if there is an error with code 500 (caused by a program's failing to execute, or to output proper headers), redirect the user to this URI."
HTH
perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'
In reply to Re: DIE or Fatals cause Redirect?
by arturo
in thread DIE or Fatals cause Redirect?
by c
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |