***************
*** 242,252 ****
  }
  
  # The mod_perl package Apache::Registry loads CGI programs by calling
- # eval.  These evals don't count when looking at the stack backtrace.
  sub _longmess {
      my $message = Carp::longmess();
      my $mod_perl = exists $ENV{MOD_PERL};
-     $message =~ s,eval[^\n]+Apache/Registry\.pm.*,,s if $mod_perl;
      return( $message );    
  }
  
--- 242,254 ----
  }
  
  # The mod_perl package Apache::Registry loads CGI programs by calling
+ # eval, as does PerlEx.  These evals don't count when looking at the 
+ # stack backtrace.
  sub _longmess {
      my $message = Carp::longmess();
      my $mod_perl = exists $ENV{MOD_PERL};
+     my $PerlEx = exists($ENV{'GATEWAY_INTERFACE'}) && $ENV{'GATEWAY_INTERFACE'} =~ /^CGI-PerlEx/;
+     $message =~ s,eval[^\n]+(Apache/Registry\.pm|\s*PerlEx::Precompiler).*,,s if $mod_perl || $PerlEx;
      return( $message );    
  }
  
