in reply to Re^2: do-ing of file without \n at the end
in thread do-ing of file without \n at the end

$! is undefined if no error has occured, and so can be set to absolutely anything. It's not clear to me why Perl ends up setting it to this particular value under these circumstances (I see the same thing on my machine), but that's really a trivia question; since the behavior is undefined, any value is valid.

Replies are listed 'Best First'.
Re^4: do-ing of file without \n at the end
by ikegami (Patriarch) on Apr 02, 2007 at 00:34 UTC
    Bad file descriptor is error 0 on some systems. It means someone did $! = 0; under the false assumption that 0 meant success. Or as a favour for those who make that assumption.