I was using Dancer's "simple" engine, which clearly doesn't parse the template vars the same as TT. I guess I was a little tired and not thinking clearly, because that fact should have been obvious.
Once I changed the engine to "Template_Toolkit" in config.yml and corrected the syntax in the template files it worked correctly.