in reply to CGI: newlines, write exactly "\r\n" to end the headers, then turn off binmode
You can still print regular (ASCII) text to STDOUT after you've used binmode(). Actually, that is what I would recommend, or alternatively, telling Perl what you actually intend to write (like binmode STDOUT, ':encoding(UTF-8)' if you're sending that.
Personally, I'm more a fan of explicitly using encode from Encode though and leaving STDOUT binmoded without any argument (binmode STDOUT, ':raw';).
|
|---|