Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Is it permitted to use a <TMPL_VAR NAME=XX> tag more than once in an HTML doc? I could assign the same value to two different tags but that feels a bit clunky!

Replies are listed 'Best First'.
Re: HTML::Template duplication of tags
by poj (Abbot) on Feb 09, 2016 at 08:01 UTC

    Yes, try it

    #!/usr/bin/perl use strict; use HTML::Template; my $template = HTML::Template->new(filehandle => \*DATA); $template->param( XX =>'variable XX' ); print $template->output; __DATA__ XX: <TMPL_VAR NAME=XX> XX: <TMPL_VAR NAME=XX> XX: <TMPL_VAR NAME=XX>
    poj
      Thank you for your response. I have now realised that it was my clunky typing in the template rather than clunky use of the module that was causing problems! :)