in reply to Re: Re: Re: Re: Need help , newbie cgi
in thread Need help , newbie cgi
call the subroutine between the table definitions.############################################################ sub print_total_by_state { ############################################################ my ($data_ref) = @_; my %cache; my $total = 0; foreach (values %$data_ref) { foreach my $state (keys %$_) { $cache{$state} += $_->{$state}; $total += $_->{$state}; } } print "<tr>\n"; print "\t<td>Total by State</td>\n"; foreach my $state (keys %cache) { print "\t<td>", $cache{$state}, "</td>\n"; } print "\t<td>$total</td>\n"; print "</tr>\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Re: Need help , newbie cgi
by britney (Acolyte) on Oct 07, 2002 at 18:29 UTC |