-2

What does the $? Ruby operator mean?

I know that it is used for system calls and can be used to tell if a system call was successful.

I tried searching for documentation but couldn't find it.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Abdul Rahman
  • 1,294
  • 22
  • 41

1 Answers1

3

There is no $ operator. $ is used to prefix global variables. What you're thinking of as an operator is actually just a bunch of predefined global variables that Ruby provides for you, which happen to have odd names like $! and $:.

See http://ruby-doc.org/docs/ruby-doc-bundle/Manual/man-1.4/variable.html

user229044
  • 232,980
  • 40
  • 330
  • 338