in reply to "use strict" sets $!
IIRC $! is only in a defined state after a failed system call, though there might be a few places where perl or some module sets it to zero before a system call. If the last system call didn't fail, $! is not guaranteed to be zero - it may have any value and its value is without defined meaning.
man 3 errno on my CentOS system says:
The <errno.h> header file defines the integer variable errno, which is set by system calls and some library functions in the event of an error to indicate what went wrong. Its value is significant only when the call returned an error (usually -1), and a function that does succeed is allowed to change errno.
Thus one of the possibilities you should consider is that the last system call succeeded but left errno with a non-zero value. Another possibility is that the last system call (or the last N system calls) all succeeded without changing the value of errno and it still has the value set from either the immediately preceding failed system call (which should have set it) or some subsequent successful system call. In other words, it might be quite difficult to determine which system call set it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: "use strict" sets $!
by rovf (Priest) on Aug 19, 2009 at 11:06 UTC | |
by ig (Vicar) on Aug 19, 2009 at 11:21 UTC | |
by rovf (Priest) on Aug 19, 2009 at 12:22 UTC | |
by ig (Vicar) on Aug 19, 2009 at 13:08 UTC |