What is the meaning of $$ in Ruby?

前端 未结 5 2038
囚心锁ツ
囚心锁ツ 2021-02-19 08:19
irb(main):002:0> $$
=> 5052

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

5条回答
  •  心在旅途
    2021-02-19 08:44

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

提交回复
热议问题