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

Re: Ways to group elements of an AoH

by fmerges (Chaplain)
on Jan 04, 2009 at 21:40 UTC ( #734056=note: print w/replies, xml ) Need Help??

in reply to Ways to group elements of an AoH


I would recommend you to use also another template system, aside of HTML::Template module for certain situations, as the transformations you need to do most times outweight the benefits of using HTML::Template, creating a code which is not so maintainable, and more centered to overcome the limitations of the module.

Update: seems to be that people are misunderstanding what I'm trying to say which is that for more complex structures than simple AoH, you end up transforming the data to make it work. I'm not saying in any means that the module is not nice and very useful, which is not the case. I also do use it a lot.


fmerges at

Replies are listed 'Best First'.
Re^2: Ways to group elements of an AoH
by bradcathey (Prior) on Jan 05, 2009 at 01:03 UTC

    Hmmmm, strong words for one of the more revered CPAN modules, and you offer no examples or recommendations, just generalizations.

    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot


      If you read carefully I say also. Thinking these are strong words is misinterpreting what I'm saying.

      Just read the way the loop works in HTML::Template, and then think about a structure which is not a AoH, tip what about iterating through a regular array?

      # given my @array = qw(apple orange peach); # now you have to change this to my @new_arr = map { { name => $_ } } @array; # and now you can say $template->param(fruits => \@new_arr);

      You want valid alternatives, check out HTML::Mason, Template::Toolkit. Yes one is not a pure templating and the other one is heavy, that's why I say also.

      Update: modified the example code to show more clearly the transformation required.


      fmerges at

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2016-10-25 05:12 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (315 votes). Check out past polls.