Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Ways to group elements of an AoH

by bradcathey (Prior)
on Jan 05, 2009 at 01:03 UTC ( [id://734089]=note: print w/replies, xml ) Need Help??


in reply to Re: Ways to group elements of an AoH
in thread Ways to group elements of an AoH

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

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

Replies are listed 'Best First'.
Re^3: Ways to group elements of an AoH
by fmerges (Chaplain) on Jan 05, 2009 at 02:32 UTC

    Hi,

    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.

    Regards,

    fmerges at irc.freenode.net

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2024-04-20 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found