ts <decoux / moulon.inra.fr> wrote:

> >>>>> "M" == Michael Schuerig <schuerig / acm.org> writes:
> 
> M> Sounds good, but poses another problem: How to find out the number of
> M> available bytes? If I call sysread with a number exceeding the number of
> M> available bytes, it runs into EOF an throws an exception. Unix read(2)
> M> behaves differently, it only reads at most the number of bytes specified
> M> and returns the actual number read.
> 
>  #sysread use internally read(2). Just catch IO::EOFError

Works, thanks. But I must admit, that I don't like using exceptions for
control-flow.

Michael

-- 
Michael Schuerig
mailto:schuerig / acm.org
http://www.schuerig.de/michael/