Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Perl 5.15.0 is now available

by zentara (Archbishop)
on Jun 21, 2011 at 11:29 UTC ( [id://910721]=note: print w/replies, xml ) Need Help??


in reply to Perl 5.15.0 is now available

$$ no longer caches PID

Can anyone explain why this was done, and what is the new method for obtaining the pid of the script?


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Replies are listed 'Best First'.
Re^2: Perl 5.15.0 is now available
by Corion (Patriarch) on Jun 21, 2011 at 12:14 UTC

    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://910721]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-29 07:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found