[Templates] creating lists

[prev] [thread] [next] [Date index for 2004/12/01]

From: Dave Howorth
Subject: [Templates] creating lists
Date: 14:46 on 01 Dec 2004
I want to collect several lists of numbers from a loop. The type of 
statements I have in mind to do this go something like:

   listname = 'an_actual_listname' ;
   a_number = 42 ;
   my_hash.$listname.push(a_number)

This doesn't work unless I prime the lists outside the loop with 
statements like:

   my_hash.an_actual_listname = [ ]

I'd like to avoid that if I can, so that I can use the existence or not 
of the hash keys as an indication of whether any of that class of 
numbers occurred, instead of iterating checking list sizes.

Is there a neat way to do this?

Thanks, Dave


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] creating lists
Dave Howorth 14:46 on 01 Dec 2004

Re: [Templates] creating lists
Andy Wardley 16:46 on 01 Dec 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52