First, I agree with the others that the best way to go is CGI.pm's header function.
I can do that with binmode(STDOUT), but then how do I turn off binmode() for STDOUT, so that I can then print regular text in the response body?
I don't think this part of the question has been answered, so yes, you can call binmode on a handle as often as you like. See the following example, in which I've shown how I would do it if I wanted to be sure Perl was sending CR+LF to STDOUT (or in this case, the currently selected handle, normally STDOUT).
$ cat test.pl
binmode select, ':crlf';
print "\x{FC}\n";
binmode select, ':raw';
print "\x0D\x0A";
binmode select, ':encoding(UTF-8)';
print "\x{FC}\n";
$ perl -wMstrict test.pl | hexdump -C
00000000 fc 0d 0a 0d 0a c3 bc 0a |........|
00000008