1 # Blosxom Plugin: seeerror -*- perl -*-
2 # Author: Todd Larason (jtl@molehill.org)
4 # Blosxom Home/Docs/Licensing: http://www.raelity.org/blosxom
5 # Categories plugin Home/Docs/Licensing:
6 # http://molelog.molehill.org/blox/Computers/Internet/Web/Blosxom/SeeError/
10 # ------------------------- Configuration Variables --------------------------
11 # Directory to create the temporary files in.
14 # * It MUST be writable
15 # * It SHOULD be readable outside Blosxom
18 # Attempt to deal with fatal errors? Should only be enabled if you need it.
20 unless defined $handle_die;
21 # ----------------------------------------------------------------------------
26 my $tmp_file = sprintf "$tmp_dir/bloserr-$$-$^T-%s.txt", CGI::remote_host();
27 open STDERR,"> $tmp_file";
31 print "content-type: text/html\n\n<h1>Possibly-Fatal Error</h1>$@";
37 close STDERR; # force a flush
38 my $fh = new FileHandle;
39 $fh->open("< $tmp_file");
40 my $errors = join '',<$fh>;
43 $errors =~ s:&:&:g;
44 $errors =~ s:<:<:g;
45 print "<h1>Error Output</h1><pre>$errors</pre>";