diff --git a/excel.psgi b/excel.psgi new file mode 100644 index 0000000..db29bb1 --- /dev/null +++ b/excel.psgi @@ -0,0 +1,109 @@ +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";
+
+
+
+