Limo has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Lame-Ass Newbie question
by ivory (Pilgrim) on Aug 03, 2000 at 23:10 UTC
    You're using "Elements of Programming Perl", right? The mathq example? You are probably creating a new $correct at each pass through the loop. Try putting "my $correct" and right after "my $quit = 0;". That way all you do is add to the value of $correct for each correct answer. If you're using a different book and this doesn't make any sense, my apologies.

    --Ivory

Re: Lame-Ass Newbie question
by Cirollo (Friar) on Aug 03, 2000 at 23:09 UTC
    Put a closing right brace on the elsif.
Re: Lame-Ass Newbie question
by Cirollo (Friar) on Aug 03, 2000 at 23:16 UTC
    Put a closing right brace on the elsif.
RE: Lame-Ass Newbie question
by Limo (Scribe) on Aug 03, 2000 at 22:49 UTC
    Sorry about the f'd-up post
    my $correct; if ($response eq 'q') { $quit = 1; } elsif ($response == $solution) { ++$correct; print "Correct! You have $correct answers\n";