in reply to Missing right curly or square bracket
If you run perltidy on your code, it will produce an error file which says that "The most recent un-matched '{' is on line 157". As others have pointed out, you will have to figure out where to put the closing }.
In Section
Seekers of Perl Wisdom