Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The FAQ works for me , after your CGI is done, after headers are sent, tell apache the status is ok, so it doesn't send ErrorDocument <a href="http://search.cpan.org/~gozer/mod_perl-1.31/faq/mod_perl_faq.pod#So_how_do_I_use_mod_perl_in_conjunction_with_ErrorDocument%3F" rel="noreferrer">http://search.cpan.org/~gozer/mod_perl-1.31/faq/mod_perl_faq.pod#So_how_do_I_use_mod_perl_in_conjunction_with_ErrorDocument%3F</a></p> <pre><code>#!/usr/bin/perl -- use strict; use warnings; use CGI; Main( @ARGV ); exit( 0 ); sub Main { my404(); #~ my $r = CGI::Simple-&gt;new-&gt;_mod_perl_request; my $r = CGI-&gt;new-&gt;r; $r-&gt;status(200); return; } sub my404 { my $cgi = CGI-&gt;new; print $cgi-&gt;header( -status =&gt; 404 ); print "&lt;html&gt;&lt;title&gt;print404 says tough noogies&lt;/title&gt; &lt;body&gt;&lt;h1&gt;tough noogies&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;"; } __END__ GET http://localhost/perl/print404 User-Agent: lwp-request/6.03 libwww-perl/6.03 404 Not Found Connection: close Date: Sun, 27 Nov 2011 20:55:39 GMT Server: Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.7g PHP/4.3.11 mod_perl/2.0.1 Perl/v5.8.9 Content-Type: text/html; charset=ISO-8859-1 Client-Date: Sun, 27 Nov 2011 20:55:39 GMT Client-Peer: 127.0.0.1:80 Client-Response-Num: 1 Client-Transfer-Encoding: chunked Title: print404 says tough noogies &lt;html&gt;&lt;title&gt;print404 says tough noogies&lt;/title&gt; &lt;body&gt;&lt;h1&gt;tough noogies&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload