use strict; use warnings; use Plack::Request; use Plack::Response; my $app = sub { my $env = shift; my $req = Plack::Request->new($env); my $rows = 20; my $cols = 10; if ($req->method eq 'POST') { my $params = $req->parameters; my $output = "
";
for my $r (0 .. $rows - 1) {
for my $c (0 .. $cols - 1) {
my $key = "cell_${r}_${c}";
my $val = $params->{$key} // '';
$output .= sprintf("%-10s", $val);
}
$output .= "\n";
}
$output .= "Back";
return [
200,
[ 'Content-Type' => 'text/html' ],
[$output]
];
}
my $html = <<"HTML";