in reply to Re: Perl stops reading __DATA__ when meeting SUB character on Windows
in thread Perl stops reading __DATA__ when meeting SUB character on Windows
I've been using Perl on Windows, and ^Z has never interrupted reading, even without binmode.
Perl on MS Windows has a long history of stopping reading at CTRL-Z (yes, even in files). That it predates your history with Perl on MS Windows (or just your memory) doesn't cause that history to no longer exist.
Your program produces 4 for me, whether binmode is commented out or not (v5.12).
I recall MS Windows changing its (default) treatment of CTRL-Z in files. This thread makes it clear that Perl did as well.
Some experiments lead me to believe that Perl has/had separate logic for stopping at CTRL-Z when reading Perl source code (and that binmode doesn't/didn't disable/reset that). I'll leave it to others to find that in the Perl source code and determine when that got removed as well (probably after v5.12 but before ikegami's version, which he doesn't mention).
At least, the DATA that Perl v5.12 opened for me stops at CTRL-Z whether binmode has been called on it or not (even after I control for the buffering problem I had experienced before and described elsewhere in this thread) while a DATA that I open myself reads CTRL-Z just fine, whether binmode is used or not.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl stops reading __DATA__ when meeting SUB character on Windows (history)
by ikegami (Patriarch) on Jan 06, 2014 at 11:54 UTC | |
by tye (Sage) on Jan 06, 2014 at 18:07 UTC | |
by ikegami (Patriarch) on Jan 06, 2014 at 18:24 UTC | |
by tye (Sage) on Jan 06, 2014 at 19:02 UTC | |
by ikegami (Patriarch) on Jan 08, 2014 at 14:55 UTC | |
| |
|
Re^3: Perl stops reading __DATA__ when meeting SUB character on Windows (history)
by Anonymous Monk on Jan 06, 2014 at 02:00 UTC |