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.
Example perl error message:
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.
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.
NOTE: Original question posted with VIM version that didn t highlight perl braces and brackets. Many newer versions do this; see vim.org for more info.