On Sun, Dec 30, 2001 at 04:35:20AM +0000, Alex Kirk wrote:
> sub display_questions(@refs)
> {
>   my @refs = @_;
>   print header(), start_html('RLDS Trivia Questions');
>   my $template = HTML::Template->new(filename => 
> '/home/www/elderlinda/quiz-template.tmpl');
>   for (my $x=0; $x<5; $x++)
>      {
>      $template->param(Q => \@refs);

In your first post, you mentioned several loops named Q1, Q2, etc, but here,
you're setting a param for the same value Q. Do you have a loop named Q?
This may be a red herring if you merged the loops into a single one.
Otherwise, I would look at that closely.

>      }
>   print $template->output;
> } 
>


> sub get_questions {
> ...<do the SELECTing, etc.>...
> my @qrefs;
>   my $count = 0;
>   for (my $x=0; $x<5; $x++)
>     {
>     my $ref = $qry->fetchrow_hashref();
>     $qrefs[$count] = $ref;
>     ++$count;
>     }
>   return(@qrefs);
> } 

Off topic, but that for loop could use some trimming
#Watch out for those 'magic' numbers!
for (my $x = 0; $x < 5; $x++){ 
    $qrefs[$x] = $qry->fetchrow_hashref(); 
}


-Gyepi Sam 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to