Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by Corion (Patriarch)
on Mar 09, 2018 at 09:53 UTC ( [id://1210555]=note: print w/replies, xml ) Need Help??


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';).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1210555]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-16 06:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found