strict is your friend. :) It's telling you that you need to explicitly scope $filename and @rows.
Try this:
my @rows;
if (@files)
{
foreach my $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);
-Matt