I know this is a big hint for me but I use 'strict' I get an error, I'm not sure how to assign the $filename and @rows to an explicit package name???#!/usr/bin/perl -W use CGI qw(param); use CGI::Carp qw(fatalsToBrowser); use DBIx::FullTextSearch; use DBIx::FullTextSearch::StopList; use DBI; use HTML::Template; use HTML::Template::Expr; my $dbh = DBI->connect('dbi:mysql:search','??????','??????') or die("C +ould not connect to database"); my $cbh = DBI->connect('dbi:mysql:cobra3','??????','??????') or die("C +ould not connect to database"); my $search = param("search_string"); my $fts = DBIx::FullTextSearch->open($dbh, '??????'); my @files = $fts->search($search); if (@files) { foreach $filename(@files){ $filename = substr($filename,0,-4); my $sth = $cbh->prepare("SELECT id, title, summary FROM resourc +e WHERE id =?"); $sth->execute($filename); while (my $ref = $sth->fetchrow_hashref()){ my $title = $ref->{title}; my $id = $ref->{id}; push @rows, { ID => $id, TITLE => $title }; } } } my $template = HTML::Template->new(filename => 'ee_search.tmpl'); $template->param(SEARCH_STRING => $search); $template->param(ROWS => \@rows); print "Content-type: text/html\n\n"; print $template->output;
In reply to Re: mod_perl advice required
by stew
in thread mod_perl advice required
by stew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |