I have the following errors:#!/usr/bin/perl -w $im_thinking_of=int(rand10); print "Pick a number:"; $guess=<STDIN>; chomp $guess; if ($guess>$im_thinking_of) { print "You guessed too high!\n"; } elsif ($guess < $im_thinking_of) { print "You guessed too low!\n"; } else { print "You got it right!\n"; }
Furthermore, it always gives me the answerArgument "rand10" isn't numeric in int at guess line 3
It is like it never reads elsif or else. This is only one example. I have other programs that have mistakes as well and it is not even my code. When I say that I copy and paste them, I mean that I read them from the book and write them again identically in my text editor.You guessed too high!
In reply to Re^2: Differences between Perl 5.8 and Perl 5.18.2
by mbgbioinfo
in thread Differences between Perl 5.8 and Perl 5.18.2
by mbgbioinfo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |