in reply to How do I find the missing curly brace??

Everyone has given lots of great advice so far, but to show you why this is a non-trival problem conciser the following code with a missing }.
if ($foo) { print "A\n"; print "B\n"; print "C\n";
Where is the missing } ? There's many places it could go and be a valid program. Only you, the programmer, knows which is the correct location.