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

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

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

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.
test.pl doesn't do that.


-- 

Michael G. Schwern   <schwern@pobox.com>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <perl-qa@perl.org>	     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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About