No, I don't know why it's a $ either - the only theory I have that's printable is that it's regexp-speak for "End of File".
Number One most likely cause for this error is a { that's missing its matching }; with the result that the file ends (unexpectedly) before all of the script's open statement blocks have been closed.