pNOK is now set, but the value hasn't been updated by stat itself. It's only when $! is referenced that the updated value materializes.
Correct. It's set by SvGETMAGIC, which is called when the value of a magic SV is needed. The state of pNOK and the like should be completely ignored by -$! since negation should call SvGETMAGIC, but negation isn't calling SvGETMAGIC in the OP's version of Perl.
In reply to Re^3: Different behaviour of 'stat' function after assignment to $! (errno).
by ikegami
in thread Different behaviour of 'stat' function after assignment to $! (errno).
by muxxum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |