in reply to How to send a "true" 404 error via Perl

Sometimes (I've never tracked down exactly why) Apache ignores some of the headers emitted by CGI scripts. The solution is to name the script nph-.... NPH stands for Non-Parsed Headers.

In older versions of Apache using nph scripts was also the only way to get an unbuffered connection.