in reply to readline succeeds but sets $! = EBADF

Can any of you duplicate this problem? I am using perl, v5.8.2 built for i686-linux.

ActivePerl v5.6.1 on Win2k does not exhibit this problem.

perl v5.8.0 for i386-freebsd on FreeBSD does not exhibit this problem.

In both cases, I also tried inserting the code open $g, "<", "nonexistant"; after the open you already have to force something into $! before you clear it.

However, your observations do not contradict $!'s definition saying that it may contain unless an error is returned. The library is allowed to do something like:

$! = bad handle; if the handle is bad, return undef; $! = bad permissions; if don't have read permissions, return undef; $! = read error; if can't read from the handle, return undef; return line read;