in reply to Re: table()'s with CGI.pm
in thread table()'s with CGI.pm
Just a couple of points on that code.
Here's a complete test program based on your code:
--#!/usr/bin/perl -w use strict; use CGI qw (:standard); my %sites; while (<DATA>) { chomp; my($name, @status) = split/\|/; $sites{$name} = [@status]; } print header; print start_html; print table(Tr(th(['Site Name', 'Site Address', 'Status', 'Comments'])), Tr([ map { td([$_, @{$sites{$_}}])} keys %sites ])); print end_html; __END__ site A|www.sitea.com|0|Not ready site B|www.siteb.org|1|Ready!!
Perl Training in the UK <http://www.iterative-software.com>
|
|---|