my $os_user = '&'; #stop warnings from yelling at you print "OS username:"; until ($os_user =~ /^[A-Za-z]{3}\d{3}$/) { chomp($os_user = <>); }