 2012/05/17
|
Last update 1999/02/20
TPJ: Issue_07_Perfect
| Issue_07_Perfect1. stack.cgi
|
Download stack.cgi
|
#!/usr/bin/perl -w
|
|
use Devel::DumpStack qw(stack_as_string);
|
|
use HTML::Entities;
|
|
|
|
sub my_die {
|
|
select(STDOUT);$|=1;
|
|
printf(<<"EOF", $?, $!, stack_as_string());
|
|
Content-Type: text/html
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>System Error</TITLE>
|
|
</HEAD>
|
|
|
|
<BODY>
|
|
<H1>System Error</H1>
|
|
A seriously bad system error happened:<P>
|
|
|
|
<B>Exit Status</B>: %d<BR>
|
|
<B>Error String</B>: %s<P>
|
|
<B>Stack Dump</B>:
|
|
<PRE>
|
|
%s
|
|
</PRE>
|
|
|
|
</BODY>
|
|
</HTML>
|
|
EOF
|
|
exit;
|
|
}
|
|
|
|
BEGIN {
|
|
$SIG{__WARN__} = $SIG{__DIE__} = \&my_die;
|
|
}
|
|
|
|
$a = undef + 4;
|
|
exit
|
| Issue_07_Perfect2. More Samples on Perfect
|

Hipocrisy of the finest: "I agree that no single company can create all the hardware and software. Openness is central because it's the foundation of choice." -- Steve Balmer (Microsoft) blaming Apple regarding iPhone, February 18, 2009Last update 1999/02/20 
All Rights Reserved - (C) 1997 - 2009 by The Labs.Com |