$num = int(rand(10)) + 1;
print "Try to guess my number! You get one try.\n";
print "Your guess: ";
$guess = <>;
chomp $guess;
if ($guess == $num) {
print "You guess my number!!\n";
} else {
print "Sorry... you guessed $guess, but my number was $num.\n";
}