in reply to Re: Best way to handle readline errors?
in thread Best way to handle readline errors?

Thanks, ikegami! That was useful.

It's worrying that <$fh> won't return when you eject and/or reinsert the media. What's going on down in the bowels of that code?

sysread and read were planned in a way which takes errors into consideration (patterned after read in c). But error handling in readline seems to be somewhat of an afterthought. It makes me wonder if I have to reimplement readline at the perl level using read (Ugh!).

I started asking this question because it's hard for me to justify writing code which will run as root that doesn't have complete error checking, including checking for input errors. Oh, Damian, why didn't Perl Best Practices should us lowly monks how to handle readline errors, too?