print"Enter the starting amount: "; while( $startAmount !~ /^\d+/ ) { $startAmount = ; chomp( $startAmount ); if ( $startAmount !~ /^\d+$/ ) { print"Numbers only! Try again: "; } else { last; } }