Sometimes on shared Cobalt servers you don't even have access to telnet or to the error_log.
It can be rather difficult to debug a script when receiving an "INTERNAL ERROR" window without any other explanations.
I'm not a perl freak, but I found this little code very handy to understand what's going on:
# Debugger begin
# Install this call on top of your CGI Script to redirect
# the error to STDOUT (as STDERR and log lile is not
# available on some Cobalt RAQ servers
#---------------------------------------------------------
BEGIN {
$| = 1;
open (STDERR, ">&STDOUT");
print "Content-type: text/plain\n\n<PRE>";
}
#---------------------------------------------------------
What it does is simply redirect the error to the browser screen instead of sending it to the log.
I hope other newbies as myself will find it useful.
Greetings,
Michel
It can be rather difficult to debug a script when receiving an "INTERNAL ERROR" window without any other explanations.
I'm not a perl freak, but I found this little code very handy to understand what's going on:
# Debugger begin
# Install this call on top of your CGI Script to redirect
# the error to STDOUT (as STDERR and log lile is not
# available on some Cobalt RAQ servers
#---------------------------------------------------------
BEGIN {
$| = 1;
open (STDERR, ">&STDOUT");
print "Content-type: text/plain\n\n<PRE>";
}
#---------------------------------------------------------
What it does is simply redirect the error to the browser screen instead of sending it to the log.
I hope other newbies as myself will find it useful.
Greetings,
Michel