Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by andal (Hermit)
on Dec 19, 2013 at 11:00 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1067808]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-20 01:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found