mexnix has asked for the wisdom of the Perl Monks concerning the following question:
my %sites; open (INFILE, "<sites.txt"); #data from file looks like this: #sitename|siteaddress|status|comments while (<INFILE>) { my($name, @status) = split/|/; $sites{$name} = @status; } close (INFILE);
Now I want to take %sites and print it into table. My first thought was that I would iterate over %sites with foreach and print a <td> each time, but when I was reading the CGI.pm documention, table() was totally different than I thought. What I want to do is print a table that looks roughly like this:
Site Name | Site Address | Status | Comments
$site | $sites{$site}->[0] | $sites{$site}->[1] | $sites{$site}->[2]
Is this possible? Or does %sites need to change to @sites or a hash reference?
__________________________________________________
%mexnix = (email = > "mexnix@hotmail.com", website => "http://mexnix.perlmonk.org");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: table()'s with CGI.pm
by Masem (Monsignor) on Jun 25, 2001 at 20:40 UTC | |
by davorg (Chancellor) on Jun 26, 2001 at 12:03 UTC | |
|
Re: table()'s with CGI.pm
by buckaduck (Chaplain) on Jun 25, 2001 at 21:09 UTC | |
|
Re: tables with CGI.pm
by petdance (Parson) on Jun 25, 2001 at 21:30 UTC | |
|
Re: table()'s with CGI.pm
by jaldhar (Vicar) on Jun 25, 2001 at 20:35 UTC | |
|
Re: table()'s with CGI.pm
by thabenksta (Pilgrim) on Jun 25, 2001 at 20:32 UTC |