#!/usr/bin/env perl
use Mojolicious::Lite;
use DBI;
our $dbh = DBI->connect("dbi:mysql:dbname=mydb;host=localhost",
\'user\', \'pass\',
{ PrintError => 0, RaiseError => 1 });
get \'/\' => sub { shift->render( \'title\' => \'Customer Search\' ) } => \'index\';
...
app->secret(\'helloworld\');
app->start;
END { $dbh->disconnect if $dbh }