our $print = sub { print shift };
sub table (&) { $print->("
\n"); shift->(); $print->("
\n"); }
sub row (&) { $print->(""); shift->(); $print->("
\n"); }
sub cell { $print->("$_ | ") for @_; }
table { row { cell "foo" } };
my $html = "";
local $print = sub { $html .= shift };
table { row { cell "foo" } };
$html .= "";