I&#39;ve created a view that&#39;s intended to write a couple of files to the file system. <br><br>The output filename needs to be dynamically set. I&#39;m having a bit of a go figuring out how to do that.<br><br>The TT configuration documentation speaks of an output subroutine:<br>
<br><div style="margin-left: 40px;">OUTPUT =&gt; \&amp;output,<br><br></div>Later on in the view base class...<br><br>sub output {<br>  my $filename = shift;<br>  # do stuff<br>}<br><br>Here&#39;s my question:<br>How do I get the $filename into sub output when I forward to the view? <br>
<br><br>Here is my view class configuration:<br><br>package hde::View::TTprint;<br><br>use strict;<br>use base &#39;Catalyst::View::TT&#39;;<br><br>__PACKAGE__-&gt;config({<br>    TEMPLATE_EXTENSION =&gt; &#39;.tt2&#39;, <br>
    INCLUDE_PATH =&gt; [<br>        hde-&gt;path_to( &#39;root&#39;, &#39;src&#39; ),<br>        hde-&gt;path_to( &#39;root&#39;, &#39;lib&#39; ),<br>        hde-&gt;path_to( &#39;root&#39;, &#39;tt2&#39; )<br>    ],<br>    PRE_PROCESS  =&gt; &#39;config/main&#39;,<br>
    WRAPPER      =&gt; &#39;site/wrapper&#39;,<br>    OUTPUT       =&gt; \&amp;output,<br>    OUTPUT_PATH  =&gt; [<br>        hde-&gt;path_to( &#39;root&#39;, &#39;static&#39;, &#39;published&#39; ),<br>    ],<br>    ERROR        =&gt; &#39;error.tt2&#39;,<br>
    TIMER        =&gt; 0<br>});<br><br>/dennis<br>