Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: HTML::Template macros

by jeffa (Chancellor)
on Dec 05, 2003 at 04:14 UTC ( #312420=note: print w/ replies, xml ) Need Help??


in reply to HTML::Template macros

++blokhead, but if you find yourself needing more of those "things", you might want to look into Template. Now don't get me wrong, i love HTML::Template, but sometimes i like having more expressional power, and Template has it:

These are my [% hobbits.size %] favorite hobbits: <ul> [% FOREACH hobbit = hobbits %] <li>[% hobbit.name %]</li> [% END %] </ul>
Another cool thing (possibly overkill) is that each hobbit could be a real object, not just a hash in a list.

Oh yeah, you can get rid of the file slurp in your code by using the filehandle attribute instead of the scalarref one:

filehandle => \*DATA,
Much nicer and more efficient. Cheers. :)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)


Comment on Re: HTML::Template macros
Select or Download Code
Re: Re: HTML::Template macros
by Anonymous Monk on Dec 05, 2003 at 07:55 UTC
    Much nicer and more efficient. Cheers. :)
    It's just as efficient, but not more efficient (look before you speak ) :D

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (13)
As of 2014-10-31 17:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (221 votes), past polls