title: Warn if declaring a variable in a statement modifier
body: <p>I just came by the following line of code:</p>
  
  <pre><code>my $foo = $bar if $cond;
  </code></pre>
  
  <p>I'm going to fix this since it will of course lead to <a href="https://stackoverflow.com/a/5915308/1733163">subtle bugs</a>.</p>
  
  <p>Is there a version of Perl, a module, or pragma that would warn if this type of statement was reached?</p>
  
  <p>For now I'm just going to use a combination of grep and PPI to scan the codebase to fix all of these issues.  Have found a total of 102 of them thus far.  However, a way of automatically warning other programmers if they add a new invalid line would be helpful.</p>