Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 545 Vote(s) - 3.65 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is the meaning of $$ in Ruby?

#1
irb(main):002:0> $$
=> 5052

What is the meaning of `$$` in Ruby and How/Where to use it?
Reply

#2
[This][1] seems like a good reference for stuff like this...has a lot of symboly goodness.

[1]:

[To see links please register here]

Reply

#3
`$$` is the [process ID](

[To see links please register here]

). It's named that way to follow Perl, which in turn followed the Bourne shell; both of them also use `$$` in the same way.
Reply

#4
pipe = IO.popen("")
if pipe
STDERR.puts "In parent, child pid is #{pipe.pid}"
else
STDERR.puts "In child, pid is #{$$}"
end

This example shows how the process ID can be used. Process ID is part of 'Execution Environment Variables' (part of predifined variables).
Reply

#5
It's the process ID of the current Ruby process. Read-only
Reply

#6
It's the process ID of the Ruby interpreter. $ is a prefix for global variables, see [here][1] for a list.


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through