Explain the use of global variable $ in Ruby? | Ruby

If you declare one variable as global we can access any where, where as class variable visibility only in the class