On Thu, Aug 17, 2000 at 09:19:20AM -0700, Peter Scott wrote:
> Do we want to come up with any modifications to the scope of $! (I'm not 
> talking about the dual string-number nature)?  I've occasionally been 
> flummoxed by looking at it when there hadn't really been an error (but it's 
> set anyway, randomly it seems); or calling some module method that failed 
> and then wondering whether $! tells me anything useful or not (did the 
> method make a failed system call?).

I think this is baggage from the days of yore, that is, C systems
programming.  Thou Shalt Care About The Value Of errno Only And Only
Only If The System Call You Just Made Failed.  Inspecting the errno
several lines or further functional calls later is pointless, anything
could have trashed it by that time.  What a successful system call
does to errno is sort of undefined.

I recently suggested in p5p that for many system calls it could be
checked in *consta...darn, *compile* time whether they are used in
void contect, and _abort_.  "No, I'm not going to let you get away
with doing a chdir() and not caring."  For some other system/library
calls, like print() and close(), this may too strict, but for those a
run-time check could be made: if they either return an error (-1, or
somesuch), or the errno flips (before the call errno would explicitly
reset to zero), we would die.  Or warn.  Whatever.  As long as there
would no way to completely ignore errors.  Though I suggested this in
a p5p thread, this is definitely more like p6 fodder.

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Reply via email to