Thread HTML::Template Frage zu LOOP (3 answers)
Opened by Tom at 2004-06-01 20:47

tomlong
 2004-06-01 21:29
#2656 #2656
User since
2003-08-04
93 Artikel
BenutzerIn
[default_avatar]
http://search.cpan.org/~samtregar/HTML-Template/Template.pm#TMPL_LOOP

Quote
my @loop_data = (); # initialize an array to hold your loop

while (@words and @numbers) {
my %row_data; # get a fresh hash for the row data

# fill in this row
$row_data{WORD} = shift @words;
$row_data{NUMBER} = shift @numbers;

# the crucial step - push a reference to this row into the loop!
push(@loop_data, \%row_data);
}

# finally, assign the loop data to the loop param, again with a
# reference:
$template->param(THIS_LOOP => \@loop_data);


HTH :)
Live long and prosper!
42;

View full thread HTML::Template Frage zu LOOP