in reply to Re^8: Set HTTP Status code
in thread Set HTTP Status code

Say I add httpd.conf  ErrorDocument 404 /error/notexist.html where DocumentRoot/error doesn't exist, then I get

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /perl/test404/junk was not found on this server.< +/p> <p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle t +he request.</p> <hr> <address>Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.7g PHP/4.3.1 +1 mod_perl/2.0.1 Perl/v5.8.9 Server at localhost Port 80</address> </body></html>

in error_log  [Mon Mar 12 02:06:58 2012] [error] [client 127.0.0.1] File does not exist:  ...htdocs/error

So your problem is most likely an apache configuration issue