title: Why can't I define a variable outside of a method and update from within a method?
body: <p>Why does this example fail?</p>
  
  <pre><code>x = 100
  y = 200
  
  def my_method
    puts "Current x/y: #{x}, #{y}" # fails to find x and y
    x += 1 # fails to find x
    y += 1 # fails to find y
  end
  </code></pre>