Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Matching names using user input 1

Status
Not open for further replies.

jnralan

Technical User
Joined
Dec 2, 2006
Messages
2
Location
GB
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
 
Hi Kevin

Yes this is a class assignment and i have an online tutor but all they do is refer you to the books you have, this may be all well and good but i believe you cant beat someone actually talking you through certain areas.

Once again thank you so much for your prompt reply

Alan
 
Please note that class/home work is not allowed to be posted on this forum. But if you show effort and ask specific questions about a piece of code or a concept you are having trouble with someone will probably help guide you instead of send you packing.

- Kevin, perl coder unexceptional!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top