This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

binmode() workaround; non ":raw" default- is this a bug or by design?


--------

to review.. the problem (UNIX style lines converted to DOS):
--v-v------------------C-U-T---H-E-R-E-------------------------v-v--
bash-2.05b$ printf "\r\n\n"|perl -pe '1;'|od -a
0000000  cr  nl  cr  nl
0000004

work around:
--v-v------------------C-U-T---H-E-R-E-------------------------v-v--
bash-2.05b$ printf "\r\n\n"|perl -pe '
  BEGIN {
    binmode (\*STDIN, q{:raw});
    binmode (\*STDOUT,q{:raw});
      # would "binmode (STDOUT,q{:raw }); be as good?
  }
  1;' | od -a
0000000  cr  nl  nl
0000003
bash-2.05b$ perl -v|grep 'This is';uname -r
This is perl, v5.8.0 built for cygwin-multi-64int
1.3.22(0.78/3/2)
<snipped>
--^-^------------------C-U-T---H-E-R-E-------------------------^-^-- 

Comments please.

--
thanks/regards,
Tom
# run below to get my address:
perl -e 'print unpack("u", "\.\=\$\!T\<F\]D\;6\%N\+F\-O\;0H\`");' 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]