Mailing List Archive

How to print binary to STDOUT
I can't find anything in the docs about how to do a "print" to
STDOUT that doesn't screw up newlines. I need to copy a binary
file to STDOUT; the script works fine in Unix, but NT adds those
nasty CRs. Ideally, I'd like to turn off the CR nonsense
entirely, forever, with a registry entry or something, and let
Perl open every file--STDIN and STDOUT included--in binary mode
like it does under Unix. Second choice would be some way to tell
it to switch STDOUT to binary mode. Third choice would be some
way to tell "print" not to screw up a particular string.
--
Lee Daniel Crocker <lee@piclab.com>
Internet/World Wide Web Consultant
http://www.piclab.com/
RE: How to print binary to STDOUT [ In reply to ]
Check out binmode(). Page 128 in the camel book.
stephan();


----------
From: Lee Daniel Crocker[SMTP:lee@piclab.com]
Sent: Monday, December 04, 1995 10:57 PM
To: 'ntperl@mail.hip.com'
Subject: How to print binary to STDOUT

I can't find anything in the docs about how to do a "print" to
STDOUT that doesn't screw up newlines. I need to copy a binary
file to STDOUT; the script works fine in Unix, but NT adds those
nasty CRs. Ideally, I'd like to turn off the CR nonsense
entirely, forever, with a registry entry or something, and let
Perl open every file--STDIN and STDOUT included--in binary mode
like it does under Unix. Second choice would be some way to tell
it to switch STDOUT to binary mode. Third choice would be some
way to tell "print" not to screw up a particular string.
--
Lee Daniel Crocker <lee@piclab.com>
Internet/World Wide Web Consultant
http://www.piclab.com/