[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Perl Problems



On Tue, Jul 19, 2005 at 11:28:30PM -0500, Harold Crouch wrote:
>   my $first_integer  # random between 0 and 9
>   my $second_integer  # random between 1 and 9
>   my $solution  # product of integers
>   my $question	  # function of integers and solution
>   my $coin_toss  # 1 for multiplication, 0 for division
>   my $response  # user's response to question
>   my $quit  # t/f for "quit"
>   my $validity  # t/f for valid characters
>   my $count_correct  # No. of correct answers
>   my $count_incorrect # No. of incorrect answers

End all of these lines with semicolons!

>       if ($response eq 'q' or response -= m/^\d+$/) {

Don't you need to call `response' as a variable here?

>       }  elsif ($response == solution) { 

Don't you need to call `solution' as a variable here?

>   Print "You gave $count_correct correct answers and $count_incorrect incorrect answers.\n" ; 

Print is lowercase as print.

-- 
Nathaniel Reindl, freelance tech support monkey and college student
Fedora Core 4 kernel 2.6.12-1.1387_FC4 on an AMD Opteron 240

"Unlike the majority of the Unix peanut gallery, I consider a
case-insensitive, case-preserving file system a screaming /feature/, not
a bug. If you have two distinct files which differ only in case, you're
a pinhead and deserve to lose."
-- Jamie Zawinski, in a comment somewhere about HFS+ in OS X

-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.