Thanks. The braces makes a lot of sense. The thing was in my real code I still got errors when I used braces. But this was actually from another iteration where $self was a different thing altogether but the error looked the same so I assumed it was.
Uh, what sort of "number of other problems". Might as well find out about them now rather than later.