Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

HTML::Template duplication of tags

by Anonymous Monk
on Feb 09, 2016 at 07:44 UTC ( [id://1154715]=perlquestion: print w/replies, xml ) Need Help??

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! :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1154715]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-24 17:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found