in reply to Knowing an IO::Socket handle has reached end-of-file

Hmm. Funny how rereading man pages produces information that you could have sworn didn't exist when you read them a few weeks ago!

I guess the practical answer is eof, as a function or a method for any IO::Handle object. The theoretical question still interests me...

dave hj~

Replies are listed 'Best First'.
Re: Re: Knowing an IO::Socket handle has
by Anonymous Monk on Jul 10, 2001 at 20:29 UTC
    No, eof doesn't work. On a socket you are ever at eof, if no data are pending. But if you read with <> not into an array, but into a single variable, perl has no choice and returns a single line (including the eol-char, but not at eof, where it is an empty string)