#!/usr/bin/perl #define a variable to store the number of planets $noplanets = 9; #displays the question to the user print "How many planets are there?"; #sets the variable $planets to whatever is input by the user and removes the line break chomp ($planets=<>); #checks to see if the user has input any incorrect answer if ($planets ne $noplanets){ #tells the program to display the text in quotation marks print "Sorry thats not right, try again\n"; #tells the program where the end of the if statement is } #tells the program what to display if the answer is not incorrect else { print "Well done there are indeed $noplanets planets in the solar system"; #ends the else statement }