#!/usr/bin/perl use strict; use warnings; my $kSolarPlanets = 8; print "How many planets are there? "; while (defined(my $planets = <>)) { chomp $planets; if ($planets == $kSolarPlanets) { print "Well done there are indeed $kSolarPlanets planets in the solar system"; last; } print "Sorry that's not right, try again: "; }