/usr/share/doc/libplack-perl/examples/dot-psgi/echo.psgi is in libplack-perl 1.0033-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | my $app = sub {
my $env = shift;
warn "This app would block with sleep(): try echo-stream.psgi"
if $env->{'psgi.nonblocking'};
my $count;
my $body = Plack::Util::inline_object
getline => sub {
return if $count++ > 5;
sleep 1;
return time . "\n";
},
close => sub {};
return [ 200, ['X-Foo' => 'bar'], $body ];
};
|