in reply to resolved: Converting code to use DATA filehandle instead of external templates
I'm a little confused. You talk about using __END__ but then you mention passing the DATA filehandle. I assume you meant to use __DATA__ instead.
HTML::Template's new() method can also take text as the template, it doesn't have to be a filehandle. Per the docs:
Alternately you can use:andmy $t = HTML::Template->new( scalarref => $ref_to_template_text, option => 'value' );These initialize the template from in-memory resources.my $t = HTML::Template->new( arrayref => $ref_to_array_of_lines , option => 'value' );
It looks like you can just slurp in your template (using while( my $line = __DATA__ ) or similar) and then pass the string to HTML::Template->new().
|
|---|