Shawn H. Corey wrote:
Peter Daum wrote:

Unfortunately, this leads right to the next problem:
I also need "binmode" to turn off cr/lf conversion on DOS;
with "while (<>)" I don't know where to do this anymore,
because AFAIK, this has to be done after open, but before
the 1st I/O; now before the "while" the file hasn't been
opened yet, after the while it is already too late ... ;-)


Anywhere before the first read. You could do it after you start reading STDIN but whatever you read before will end in "\r\n".


binmode STDIN, ':raw';
while( <> ){

... but in this case, "while(<>)' is "open" and "read" at the same time;
no matter where I put the binmode call, it doesn't have any effect,
while the same program with

open F, "filename";
binmode(F);
while(<F>) {
   ...

works fine


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to