Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: HTML::Template macros

by jeffa (Bishop)
on Dec 05, 2003 at 04:14 UTC ( [id://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)

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://312420]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-25 21:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found