title: How to make a page-specific title in Dancer templates?
body: <p>I have a standard Perl Dancer app, using Template::Toolkit as rendering engine, with two routes:</p>
  
  <pre><code>get '/' =&gt; sub {
      template 'index';
  };
  
  get '/foo' =&gt; sub {
      template 'foo';
  };
  </code></pre>
  
  <p>My <code>views/templates/main.tt</code> contains the line:</p>
  
  <pre><code>&lt;title&gt;&lt;%= title %&gt;&lt;/title&gt;
  </code></pre>
  
  <p>I want the value of title var be "My Site" on page '/', and "Foo - My Site" on page '/foo'.</p>
  
  <p>I know I can put these values in the controller file, like this:</p>
  
  <pre><code>    template 'index', { title =&gt; 'My Site' };
  </code></pre>
  
  <p>but I want to specify them in the corresponding template files, <code>views/index.tt</code> and <code>views/foo.tt</code>.</p>
  
  <p>How can I do that?</p>
  
  <p>Thanks.</p>