in reply to Re^6: Best way to handle readline errors?
in thread Best way to handle readline errors?
In the case of EOF, $! (or errno) is not modified and will have the value it had before readline was called, since the system call(s) have not failed.
That's wrong, according to the docs for $!. The value of $! is undefined if no error has occured. You cannot count on it being unchanged.
Furthermore, it's observably wrong on my system. $! does not remain unchanged after EOF, or even after reading a line successfully.
To answer your earlier question, yes, readline is wrong.
|
|---|