Basilides has asked for the wisdom of the Perl Monks concerning the following question:
If I query my database with
I'd then like to output each row of data as a row in an HTML table. Basically, something like:my @table = @{$sth->fetchall_arrayhref({})};
But obviously I'm not allowed that foreach in the middle of my print statement.print $query->table( $query->Tr( foreach @table { $query->td([$_->{name}, $_->{year}, $_->{rating}],) } ), );
What's a good way of doing this?
Cheers
Dennis
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Outputting data to tables with CGI.pm
by chromatic (Archbishop) on May 25, 2003 at 20:48 UTC | |
|
Re: Outputting data to tables with CGI.pm
by The Mad Hatter (Priest) on May 25, 2003 at 20:21 UTC | |
by arthas (Hermit) on May 25, 2003 at 23:18 UTC | |
|
Re: Outputting data to tables with CGI.pm
by blokhead (Monsignor) on May 25, 2003 at 20:47 UTC | |
|
Re: Outputting data to tables with CGI.pm
by Basilides (Friar) on May 25, 2003 at 21:35 UTC |