jonnyfolk has asked for the wisdom of the Perl Monks concerning the following question:
my $template = HTML::Template->new(filename => $temp_late, die_on_bad_params => 0); my @loop; # the loop data will be put in here # fill in the loop, sorted by timestamp foreach $count (sort keys %table) { # get the other data from the data hash ($eenie,$meenie,$minie,$mo,) = @{table{$count}}; # make a new row for this data - the keys are <TMPL_VAR> names # and the values are the values to fill in the template. my %row = ( eenie => $eenie, meenie => $meenie, minie => $minie, mo => $mo, ); # put this row into the loop by reference push(@loop, \%row); } # call param to fill in the loop with the loop data by referen +ce. $template->param(member => \@loop); # print the template print $template->output;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sorting a hash for use in HTML:: Template
by valdez (Monsignor) on Jan 20, 2004 at 22:49 UTC | |
|
Re: sorting a hash for use in HTML:: Template
by Roger (Parson) on Jan 20, 2004 at 22:48 UTC |