in reply to Template::Plugin::DBI question

You can do it the same was way, almost, as the CGI and you should probably modify your CGI call. Something like this–

my %vars = ( cgi => CGI->new(), dbh => DBI->connect([connection params]), );

You can just follow the regular docs for those modules then. It's sometimes terribly convenient to code DB calls and such inside templates (hence PHP's rapid rise) but it's usually a bad long term design choice.