That's because of the die on line 74.
If your script dies, it passes a non-zero exit value to the invoking process - your web server.
From the exit value it deduces something went wrong, so it sets a status of 500 - internal server
error - and displays anything that was thrown out STDERR at the exit of your script - which is
the error you want to have displayed.
You surely do not want die there at line 74, but instead print a header with status 200
(if not already printed), print your error message to STDOUT, and exit after that.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
| [reply] |
But i though local *STDERR = *STDOUT was supposed to redirect all errors to the default output which is the screen instead of the error.log. I still dont see why die thre print my erro message and also the default of dies as well....
Perhaps you can make it more clear to me if it aint a bother.
| [reply] |
But i though local *STDERR = *STDOUT was supposed to redirect all errors to the default output
There. You are giving yourself the answer :-)
That's why the error shows on your "screen" - i.e. the browser. It gets the STDERR
because you have redirected it to STDOUT, otherwise it would be directed to the error log.
Don't do that, don't die on line 74, just print the error message, then exit.
All will be fine, and because, then, your scripts exits 0, no 500 error page will be generated.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
| [reply] |