Re: repeat through hash

Jonathan Vanasco <[email protected]> Thu, 20 Apr 2006 17:05:56 -0400
Newsgroups gmane.comp.lang.perl.modules.petal
Message-ID <[email protected]>
On Apr 19, 2006, at 9:34 PM, Peter Rabbitson wrote:
> What you probably need is the each: function provided by Petal::Utils.

just be wary that its not strict tal - so you won't be able to use  
your Petal templates with python or php

generally, what i do is this:

	pull everything from the db into a hash using named keys , and a  
_HASHNAME_order array that has the order of the keys if necessary
	do what i must with the data
	for output, just create a new array, and loop through the order of  
hash keys tossing a ref to the element into the item

petal is great in that it'll dereference most refs automagically so  
there's almost no performance hit in 90% of what you need to do