I had a look at strict.pm, but didn't find anything which might possibly set $! in this case.
strict.pm is a file. When use strict; is compiled perl searches the directories in @INC until it finds the strict.pm file. Several system calls may be executed as it traverses @INC. Even if strict.pm is in the first directory in @INC, at least two system calls will be required to open the file and read its contents. These system calls could set errno as they succeed.
strict.pm sets several variables. Doing so may cause perl to acquire more memory from the system. The system call (perhaps malloc) may set errno when it succeeds.
So there are at least a few system calls involved in loading the strict module, any one of which might have set errno, causing $! to be set.
In reply to Re: "use strict" sets $!
by ig
in thread "use strict" sets $!
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |