in reply to "Impossible" socket error return

How can it get undef back, without $! being set?

readline (for which <$fh> is a shortcut) returns undef on end of file as well as on error.

By the way, there's no way to know if $! is meaningful after readline because readline has no way of signaling an error occurred.

Replies are listed 'Best First'.
Re^2: "Impossible" socket error return
by dd-b (Pilgrim) on Sep 28, 2011 at 14:55 UTC
    Thanks! Yes, it was indeed the obvious. Bug in another bit entirely was causing it to disconnect at an inopportune moment.