title: Using same ruby block is now throwing errors
body: <p>Consider this block of code:</p>
  <pre class="lang-rb prettyprint-override"><code>f = File.new('test')
  f.each_line { |line|
    if line =~ /@b/ then
      x = line
    end
  }
  y = x[/&lt;(.*)&gt;/,1]
  </code></pre>
  <p>This is <code>f</code>:</p>
  <pre><code>@a &lt;1,2,3&gt;
  @b &lt;'whatever'&gt;
  @c &lt;['x','y','z']
  @d &lt;1.1&gt;
  </code></pre>
  <p>and
  Originally, this block of code was working, returning <code>y</code> as <code>'whatever'</code>, but is now throwing this error:</p>
  <pre><code>Traceback (most recent call last):
          4: from C:/Ruby26-x64/bin/irb.cmd:31:in `&lt;main&gt;'
          3: from C:/Ruby26-x64/bin/irb.cmd:31:in `load'
          2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `&lt;top (required)&gt;'
          1: from (irb):10
  NameError (undefined local variable or method `x' for main:Object)
  </code></pre>
  <p>Any suggestions?</p>
  <blockquote>
  <p>P.S.</p>
  <p>This is being run directly through irb</p>
  </blockquote>