title: Does Ruby's $! hold value only in rescue block?
body: <pre><code>begin
    raise 'foo'
  rescue
    puts $!.inspect # =&gt; #&lt;RuntimeError: foo&gt;
  ensure
    puts $!.inspect # =&gt; nil
  end
  puts $!.inspect # =&gt; nil
  </code></pre>
  
  <p>Googled around but didn't find a clear answer.</p>
  
  <p>Just want to confirm the life-time(?) of <code>$!</code>, does it hold value only inside a <code>rescue</code> block?</p>