Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: Perl stops reading __DATA__ when meeting SUB character on Windows (commit)

by tye (Cardinal)
on Jan 06, 2014 at 18:07 UTC ( #1069557=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Perl stops reading __DATA__ when meeting SUB character on Windows (history)
in thread Perl stops reading __DATA__ when meeting SUB character on Windows

Part of the puzzle might be p5git://commit=9b1f1815, which became part of v5.14.

The OP is using binmode. That should never stop at ^Z!

So if Perl hits EOF due to CTRL-Z (while reading source code), then subsequently doing binmode will clear that EOF condition?

- tye        


Comment on Re^4: Perl stops reading __DATA__ when meeting SUB character on Windows (commit)
Re^5: Perl stops reading __DATA__ when meeting SUB character on Windows (commit)
by ikegami (Pope) on Jan 06, 2014 at 18:24 UTC

    If you're asking if it should, then probably not. I have no idea what it actually does.

    I don't see how that's relevant to this situation or the text you quoted. Perl should not have reached the ^Z while reading the source code. It should have found __DATA__ first.

      Perl should not have reached the ^Z while reading the source code. It should have found __DATA__ first.

      So how big of a buffer do you suppose is being used when Perl is reading from a file looking for "__DATA__"?

      - tye        

        Are you saying it's ok for binmode(DATA, ...) only to take effect partway through the data? No, that's a bug.

        It doesn't matter how big the buffer is. It could be big enough to contain the entire file. The parser can't go changing bytes later in the file unless it knows it's safe to do so or it has a means of restoring them. Otherwise, it breaks DATA.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1069557]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2014-12-21 17:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (106 votes), past polls