#!/usr/bin/perl -w use strict; my $num; while() { print 'Enter a number between 1 and 10 (inclusive): '; chomp( $num = ); if( $num gt "9" ) { print "Numbers only. That was a string!\n"; next; } if( $num < 1 || $num > 10 ) { print "Please enter a value greater than one or less than 10\n"; next; } print "Thank you. You entered $num\n"; last; }