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

Re^2: Format and Join an Array in a Template

by mscharrer (Hermit)
on Jun 19, 2009 at 17:09 UTC ( [id://773091]=note: print w/replies, xml ) Need Help??


in reply to Re: Format and Join an Array in a Template
in thread Format and Join an Array in a Template

Thanks, this works (with .slice(0,-2)). I was simply thinking the wrong way. The fact that the format must be used twice is a little drawback, but I think it does not get much shorter.

It is a pity that the Template module does not provide a 'map' virtual method, otherwise a 'list.map(...).join(...)' would be possible.

Replies are listed 'Best First'.
Re^3: Format and Join an Array in a Template
by ikegami (Patriarch) on Jun 19, 2009 at 17:26 UTC

    The fact that the format must be used twice is a little drawback,

    You could use a [% BLOCK %] to remove the redundancy.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-28 17:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found