in reply to Creating an HTML table with 'n' rows

First, both Tr and td expect an array reference as their second argument, not a list. Aesthetically, I'd also suggest using map instead of foreach in the loop. Put together,
#!/usr/local/bin/perl use CGI qw/:standard/; my @data = ([qw/x y z/], [qw/a b c/], [qw/1 2 3/]); print header, table({-width=>200}, [join '', (map Tr(map td($_), @$_), @data)]);
will give you what you want, I believe.

UPDATE

Whoops! I ignored my own advice. The above should work, but isn't too clear logically. This is what I was trying to do:

#!/usr/local/bin/perl use CGI qw/:standard/; my @data = ([qw/x y z/], [qw/a b c/], [qw/1 2 3/]); print header, table({-width=>200, -border=>1}, [Tr([map (td([map $_, @$_]), @data)])]);
Hope that helps.