Huh? How do you get that? Doesn't work that way for me...
(perl 5.8.6 on macosx/darwin)
$_ starts out as undefined until something other than undef is assigned to it, and after that, assigning undef to it appears to have the expected result.
I would think most 5.* perl versions to behave the same in this regard, so maybe you were doing things differently?
(update: oops! Sorry, I got confused about which variable was being talked about there. Thanks to jrw for setting me straight.)
warnings from <readline> sent to stderr will have to be handled in some way
Right. Open STDERR to a scalar:
It might suffice just to do that, and check the length of that scalar after each "readline" operation. (If it's not empty, do something about it; and if it's appropriate to continue, reset it to an empty string before continuing.)open( STDERR, ">", \$stderr_log );
Also, if readline fails and returns false, you have eof($fh) that will also return false if the readline failure was due to an error (rather than end-of-file). Are you saying that you are having some problem getting that to work the way you want? (You haven't mentioned what OS you're using, or what sorts of errors you're worried about...)
In reply to Re: Best way to handle readline errors?
by graff
in thread Best way to handle readline errors?
by jrw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |