Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: mod_perl advice required

by DrManhattan (Chaplain)
on Feb 25, 2003 at 15:39 UTC ( [id://238454]=note: print w/replies, xml ) Need Help??


in reply to Re: mod_perl advice required
in thread mod_perl advice required

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

Replies are listed 'Best First'.
Re: Re: Re: mod_perl advice required
by shirkdog_perl (Beadle) on Feb 25, 2003 at 16:34 UTC
    In a way, use strict is more important than warnings.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://238454]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-25 19:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found