2008/07/21

The Labs.Com Issue_07_Perfect
Last update 1999/02/20

TPJ: Issue_07_Perfect

This is a collection of programs published by The Perl Journal. You can download all source-code also from TPJ: Programs.
Issue_07_Perfect
1. 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_Perfect
2. More Samples on Perfect

  • Issue_07_Perfect

                                                                                                                                   

Last update 1999/02/20

All Rights Reserved - (C) 1997 - 2008 by The Labs.Com

Top of Page

The Labs.Com