Lesson 05
IF THEN ELSE

Created 2005-02-08 / Edited 2005-02-08
  $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";
  }