Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: IO::Handle->getline() partial reads from pipe

by andal (Hermit)
on Dec 19, 2013 at 11:00 UTC ( #1067808=note: print w/replies, xml ) Need Help??


in reply to Re: IO::Handle->getline() partial reads from pipe
in thread IO::Handle->getline() partial reads from pipe

Well, buffered IO does work with sockets, you just have to take into account all of the corners of such use :)

In this particular case one must actually see the code and analyze the data flow, using for example strace. In simple tests, the getline works correctly with pipes. It blocks waiting for EOF or for next "\n". It returns not earlier than obtaining either of those. Completely different story happens when the reading end of pipe is in "non-blocking" mode. Here getline may produce incomplete lines and in general reading would require a lot of care.

  • Comment on Re^2: IO::Handle->getline() partial reads from pipe

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2021-01-20 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?