Re: [htmltmpl] LOOP over array of scalar elements

2003-12-23 Thread Gabor Szabo
On Mon, 22 Dec 2003, Roger Burton West wrote: > On Mon, Dec 22, 2003 at 09:49:48AM -0200, Gabor Szabo wrote: > > >So far the only way I could think of is to go over these arrays and > >replace the scalar values with hash-refs: > > Correct. You can do this in a single pass, of course: > > $tmpl->

Re: [htmltmpl] LOOP over array of scalar elements

2003-12-22 Thread Roger Burton West
On Mon, Dec 22, 2003 at 09:49:48AM -0200, Gabor Szabo wrote: >So far the only way I could think of is to go over these arrays and >replace the scalar values with hash-refs: Correct. You can do this in a single pass, of course: $tmpl->param(items => [map{{item => $_}} @items] ); (untested but ou

Re: [htmltmpl] LOOP over array of scalar elements

2003-12-22 Thread Mathew Robertson
your suggested solution - is the correct solution cheers, Mathew - Original Message - From: "Gabor Szabo" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 22, 2003 10:49 PM Subject: [htmltmpl] LOOP over array of scalar elements > > It mig

[htmltmpl] LOOP over array of scalar elements

2003-12-22 Thread Gabor Szabo
It might be a very simple question but I could not find the answer so far: In a larger hash I have an array-ref with simple scalars in it items => [ 'apple', 'banana', 'orange' ] I'd like to use this directly in a H:T with something like the following but