KCatch.pm - Catch warn and die to avoid ``Internal Server Error''
use KCatch;
print "Content-Type: text/html\n\n";
warn;
die;
1ST STEP) Upload KCatch.pm to your script's directory or to @INC.
2ND STEP) Insert just a line "use KCatch;" at top of your script.
3RD STEP) This module could not work without the bug you made! :-)
use KCatch qw( [OPTIONS] );
KCatch.pm would automatically detect whether running under CGI or not, when no options given. Available options are following:
use KCatch qw( plain ); # Original style
use KCatch qw( mode=plain ); # New style
Force to make output as plain text for command-line use.
use KCatch qw( html ); # Original style
use KCatch qw( mode=html ); # New style
Force to make output as HTML for CGI.
use KCatch qw( source );
Display also warned or died Perl source code for debugging. (Note: The options could make influence on some security problems to display your code for the users.)
use KCatch qw( stderr );
Output additional information of CGI to STDERR. Usually, it would be saved to ``/usr/local/apache/logs/error_log''.
use KCatch qw( execdata );__DATA__
Execute code after token ``__DATA__'' in the file which calls KCatch. You should put the token ``__DATA__'' just next to call KCatch. This option is VERY STRONG to force to catch almost the all errors, and becomes the Savior in case your-annoying-bugs never disappears!
use KCatch qw( jcode=sjis );
use KCatch qw( jcode=euc );
use KCatch qw( jcode=jis );
Convert the charactor-code-set of the error infomations for Japanese. This option make work when ``jcode.pl'' is already required.
1999/11/05 v1.02 First Release
1999/11/23 v1.03 Recognize between under "use" and "require"
2000/04/25 v1.04 Bug fix: undefined $ENV{GATEWAY_INTERFACE}
2000/05/03 v1.05 Add options "use KCatch qw( source );", etc.
2000/05/05 v1.06 Bug fix: undefined $ENV{REQUEST_URI}
2000/08/04 v1.07 Output additional information to STDERR
2000/10/27 v1.08 No use of uninitialized values
2000/12/09 v1.10 the Savior option qw( execdata ) avaliable!
output templete separated, jcode=* supported
http://www.kawa.net/works/perl/catch/
http://www.harukaze.net/~mishima/perl/cgi-debug-env/deb-tech.html
http://www.layer-8.com/sce/smp_detail.php3?argCatId=7&argSmpId=3
Copyright 1999-2000 Kawasaki Yusuke <u-suke [at] kawa.net>