/usr/share/doc/libplack-middleware-debug-perl/examples/dbi/app.psgi is in libplack-middleware-debug-perl 0.16+dfsg-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 18 19 20 | # Do this: sqlite3 examples/dbi/foo.db < examples/dbi/dump.sql
use Plack::Builder;
use File::Basename;
my $db = File::Basename::dirname(__FILE__) . "/foo.db";
my $app = sub {
use DBI;
my $dbh = DBI->connect("dbi:SQLite:dbname=$db", "", "");
my $sth = $dbh->prepare("SELECT * FROM foo");
$sth->execute;
1 while ($sth->fetchrow_arrayref);
return [
200, [ 'Content-Type' => 'text/html' ],
['<body>Hello World</body>']
];
};
builder {
enable 'Debug', panels =>
[qw(Environment Response Timer Memory), [ 'DBITrace', level => 2 ]];
$app;
};
|