title: What does Ruby's BEGIN do?
body: <p>What does <code>BEGIN</code> mean in Ruby, and how is it called? For example, given this code:</p>
  
  <pre><code>puts "This is sentence 1."
  
  BEGIN {
    puts "This is sentence 2."
  }
  </code></pre>
  
  <p>why is <code>puts "This is sentence 2."</code> executed first?</p>