title: What is the usefulness of CHECK, UNITCHECK and INIT blocks in Perl?
body: <p>I know what they all do, but have never found myself in a situation where I've needed any of them. I've used <code>BEGIN</code> blocks on many occasions and <code>END</code>s once in a while. <code>BEGIN</code> is especially useful when you need to tweak the environment before code gets run, and I've used <code>END</code> in certain debugging situations to trap important state information for hard-to-track-down fatal errors.</p>
  
  <p>Have you ever used <code>CHECK</code>, <code>UNITCHECK</code> or <code>INIT</code>? If so, what for? And would a <code>BEGIN</code> block  not have sufficed for some reason? </p>
  
  <p>The documentation for the blocks is on <a href="http://perldoc.perl.org/perlmod.html#BEGIN%2C-UNITCHECK%2C-CHECK%2C-INIT-and-END" rel="noreferrer">PerlDoc</a>.</p>