in reply to Table Help

Is this a webpage? Just loop thru the data and put the correct html tags in it. Something like this untested typofiled code:
print "<table border=1>"; while (<DATA>) { my @values = split(/,/, $_); print "<tr><td>" . $value[0] . "</td><td>" . $value[1] . "</td></tr>\n +"; } print "</table>"; __DATA__ foo,bar baz,quux Mike,Micky Davy,Peter
Output should be something like:
foobar
bazquux
MikeMicky
DavyPeter
If you're not creating a webpage please use the suggestions already provided.

Replies are listed 'Best First'.
Re^2: Table Help
by stonecolddevin (Parson) on Apr 27, 2006 at 23:37 UTC
    Ew, good God, if you're going to do that, use CGI.
    use strict; use warnings; use CGI; my $q = CGI->new; my @values = grep {@$_} map {chomp; [split ',']} <DATA>; my $rows = "\n"; $rows .= $q->Tr ( {align => 'center', valign => 'top'}, [$q->td ([$_->[0]]) . $q->td ([$_->[1]])] ) . "\n" for @values; print $q->header, $q->start_html, $q->table({border => 1}, [$rows]); __DATA__ foo,bar baz,quux Mike,Micky Davy,Peter
    meh.