Hi everyone I'm desperate for help here i hope someone can offer me help, I'm creating a form based on user input, the first thing i have done is to ask for a 4 digit reference number (no more or no less)and then ask for a title, i guess i have to create an array and match user input, my array must consist of the following titles, (Dr, Lady, Lord, Miss, Mr, Mrs, Ms, and Sir)if a user enters one of these titles then the value is true then i have to move on to ask for surname ect but if false it must prompt again until a match is found.
this is what i have so far
print ("Please enter the customers reference number:\n");
$CustNum = <STDIN>;
chomp ($CustNum);
while ($CustNum !~m/^[0-9]{4}$/)
{
print ("Incorrect please try again:/n");
$CustNum = <STDIN>;
chomp ($CustNum);
}
print ("Please enter your Title:/n");
$Title = <STDIN>;
chomp ($Title);
i know its a bit of a newb question but this has me pulling my hair out (what is left of it) any help would be most appreciated, cheers
this is what i have so far
print ("Please enter the customers reference number:\n");
$CustNum = <STDIN>;
chomp ($CustNum);
while ($CustNum !~m/^[0-9]{4}$/)
{
print ("Incorrect please try again:/n");
$CustNum = <STDIN>;
chomp ($CustNum);
}
print ("Please enter your Title:/n");
$Title = <STDIN>;
chomp ($Title);
i know its a bit of a newb question but this has me pulling my hair out (what is left of it) any help would be most appreciated, cheers