If I rewrite connect_db as:

my $dbh;
sub connect_db {

if (! defined $dbh) {
$dbh = DBI->connect("dbi:SQLite:dbname=".setting('database')) or
die $DBI::errstr;
}
return $dbh;
}
will the application use a single connection for all connections under all perl webservers (in-built, mod_perl, Starman, Twiggy etc.).
If that is true, a line to that effect in an appropriate place in the tutorial would emphasize the persistent features of the solution.

Also, are any hooks run when the application instance is destroyed? If there are, implementing a graceful closing of open DB connection(s) might provide a valuable lesson in the Tutorial.

Thank you.