title: How do I fix the perl syntax error "missing right curly or square bracket" using VIM?
body: <p>Compiling (or executing) a perl program with unmatched array braces ("[ ]") or scope brackets ("{ }") causes the "missing right curly or square bracket" syntax error. Perl often reports the source as your last code line ("at EOF"), which could be far removed from the actual missing piece.</p>
  
  <p>Example perl error message:</p>
  
  <pre><code>Missing right curly or square bracket at ./foo.pl line 100, at end of line
  syntax error at ./foo.pl line 100, at EOF
  Execution of ./foo.pl aborted due to compilation errors.
  </code></pre>
  
  <p>How do vi or Vi IMproved (VIM) users troubleshoot this error message? I've added an answer with some VIM enhancements. Please add your own ideas, practices, or vi plugins.</p>
  
  <p>NOTE: Original question posted with VIM version that didn't highlight perl braces and brackets. Many newer versions do this; see <a href="http://www.vim.org/" rel="nofollow noreferrer">vim.org</a> for more info.</p>