Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: CGI.pm HTML-Generation Methods Considered Useful

by jonadab (Parson)
on Jul 10, 2004 at 19:24 UTC ( [id://373389]=note: print w/replies, xml ) Need Help??


in reply to CGI.pm HTML-Generation Methods Considered Useful

$html .= $q->table( { -bgcolor => '#ffffff', -border => 1 }, $q->caption('Status Summary'), # beware beautiful nested maps ahead $q->Tr( [ map { my $k = $_; $q->td( [ $k, map { $data->{$k}{$_} } sort keys %{ $data->{$k} } ] ) } sort keys %{ $data } ] ) );

I fail to see how this is preferable to the normal way of doing it:

$html .= "<table class=\"foo\"><thead><tr>" . (join "\n", map {"<th>$_</th>"} @field) . "</tr></thead><tbody>\n" . (join "\n", map { my %record = %$_; "<tr class=\"".(somecondition($_))."\">" .(join "\n", map {"<td>$record{$_}</td>"} @field)."</tr>" } @record) . "</tbody></table>\n";

;$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$;[-1]->();print

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://373389]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2024-03-28 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found