##necessary stuff, use CGI etc... use constant TMPL_FILE => "C:/Xitami/cgi-bin6/templates/mytemplate.tmpl"; my $tmpl = new HTML::Template( filename => TMPL_FILE, no_includes => 1 ); ##some other bits, then $dbh=DBI->connect($datasource,$user,$pass,{AutoCommit=> 1}) or die "Can't Connect"; $sth=$dbh->prepare("SELECT * FROM Videos WHERE $FieldN LIKE ?") or die; $sth->execute($SearchCrit); @vidinfo = $sth->fetchrow_array();