以下のようにcgiで動かしているのですが、httpヘッダがそのまま表示
されてしまいます。

#!/usr/bin/perl
$| = 1;
print "Content-type: text/html\n";
print "Pragma: no-cache\n\n";
print "<html>test</html>";

-----------------------------------
tcpをダンプしたらこんな感じでした。ヘッダとして出しているつもりが本文となってしまっています。

HTTP/1.1 200 OK
Date: Thu, 15 Apr 2004 10:20:52 GMT
Server: Apache
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=EUC-JP

18
Content-type: text/html

12
Pragma: no-cache


11
<html>test</html>
0
-----------------------------------
$| = 1; を外すと正常に動きます。何故なのでしょうか?
(apache2です)