in reply to Win32::Pipe, how to tell if the other side went away?
I'm not in a position to test this speculation, but try checking the value returned by Win32::GetLastError(), (which may or may not be the same as $^E), immediately after Peek() returns false. I would expect, but cannot substantiate that you woud get a different error code if the pipe is just empty, to if it has disconnected.
Maybe RPC_X_PIPE_EMPTY (1918L) in the former case and RPC_X_PIPE_CLOSED (1916L) in the latter. Those are guesses, there are several possibilities. Should be fairly easy to verify (once you have a working copy of a version of Win32::Pipe that supports the Peek() function :()
|
|---|