title: How can I smoke out undefined subroutines?
body: <p>I want to scan a code base to identify all instances of undefined subroutines that are not presently reachable.</p>
  
  <p>As an example:</p>
  
  <pre><code>use strict;
  use warnings;
  
  my $flag = 0;
  if ( $flag ) {
    undefined_sub();
  }
  </code></pre>
  
  <h3>Observations</h3>
  
  <ul>
  <li><p>When <code>$flag</code> evaluates to true, the following warning is emitted:</p>
  
  <pre><code>Undefined subroutine &amp;main::undefined_sub called at - line 6
  </code></pre>
  
  <p>I don't want to rely on warnings issued at run-time to identify undefined subroutines</p></li>
  <li><p>The <code>strict</code> and <code>warnings</code> pragmas don't help here. <code>use strict 'subs'</code> has no effect.</p></li>
  <li><p>Even the following code snippet is silent</p>
  
  <pre><code>$ perl -Mstrict -we 'exit 0; undefined_sub()'
  </code></pre></li>
  </ul>