http://www.perlmonks.org?node_id=1210564


in reply to Re: CGI: newlines, write exactly "\r\n" to end the headers, then turn off binmode
in thread CGI: newlines, write exactly "\r\n" to end the headers, then turn off binmode

"\n\n" is the correct way to end the header.

How do you reconcile that statement with:

  1. The HTTP 1.1 spec which requires the last header be followed by two CRLF sequences.
  2. The fact that $cgi->header; returns the string: "Content-Type: text/html; charset=ISO-8859-1" terminated by "\x0D\x0A\x0D\x0A"?