develooper Front page | perl.perl5.porters | Postings from September 2001

binmode(STDOUT, ":unix") busted when STDOUT is piped.

Thread Next
Michael G Schwern
September 25, 2001 12:31
binmode(STDOUT, ":unix") busted when STDOUT is piped.
Message ID:
$ ./perl -wle 'print "foo";  binmode(STDOUT, ":unix");  print "bar"' | less

Very interesting.  binmode(STDOUT, ":unix") somehow retroactively
breaks STDOUT if and only if STDOUT is going to a pipe.

This is why t/op/binmode.t is failing now.  Test::More had dup'd
the STDOUT filehandle before binmode could get it's hands on it. doesn't do that.


Michael G. Schwern   <>
Perl6 Quality Assurance     <>	     Kwalitee Is Job One
It should indeed be said that notwithstanding the fact that I make
ambulatory progress through the umbragious inter-hill mortality slot,
terror sensations will no be initiated in me, due to para-etical phenomena.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About