print"Enter the starting amount: "; { chomp( $startAmount = ); unless ( $startAmount =~ /^\d+$/ ) { print"Numbers only! Try again: "; redo; } # this line is reached if $startAmount is a number print "ok, \$startAmount is $startAmount\n"; }