Of course it didn't expect the $, it aint there..
Usually, and in fact the most recent time, this error is caused by some unnecessary or misplaced oddball character..
The last few times I got this error it was because I tried to use an asp style comment in my code..
'this is an asp comment
what i wanted was a php style comment
//this is a php comment
that's what i get for being sucked into the microshaft.
But all is well since my conversion to php...