Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: can you repeat a character N times using HTML::Template?

by barrd (Prior)
on Nov 01, 2003 at 12:20 UTC ( #303800=note: print w/ replies, xml ) Need Help??


in reply to can you repeat a character N times using HTML::Template?

Hiya spditner,

Is there some way to get HTML::Template to repeat a character N times, say  , without resorting to HTML::Template::Expr?
Nope. :)

But... using Zaxo's advice above you could get the script to prepare a HTML::Template param for inclusion into your .tmpl template like so:

# Original code by Zaxo my $repeated = '&nbsp;' x $foo->{'depth'}; my $line = $repeated . $foo->{'name'} . "<br />"; my $template = HTML::Template->new(filename => 'foo.tmpl'); $template->param(html_out => $line);
Then in foo.tmpl you would call the result by using something like:
<TMPL_VAR NAME="html_out">
Not sure if that's the kind of answer you were looking for, but its one way of achieving your desired result.


Comment on Re: can you repeat a character N times using HTML::Template?
Select or Download Code
Replies are listed 'Best First'.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://303800]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2015-07-31 23:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls