I introduced this change, so I guess I should explain the idea behind it:
The old method of using $$ is still the way to get at your scripts PID. The only change is that the value of $$ is directly retrieved from getpid instead of being cached.
It used to be (up to 5.14.x) that $$ gets the value of getpid() and caches it at program start or at the first read. Whenever the Perl script calls fork, the cache needed to be updated. This opened a bug opportunity when a module called POSIX::fork or called fork(3) directly, and forgot to update the cached value.
|