runtime/global/variables_parens.rb

tests/_examples/runtime/global/variables_parens.rb in the metorex repository.

# Global variables with $ prefix (with parentheses)
$count = 0

def increment
  $count = $count + 1
end

increment
increment
increment
puts($count)

$message = "hello"
puts($message)

Output:

3
hello