Whoops..... $answer =~ m/^y|n$/i :O)
----- Original Message ----- From: "John W. Krahn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 10, 2003 2:38 PM Subject: Re: Delimiter Question > Mark Goland wrote: > > > > > How do I challenege more than one variable like I want to > > > check for the input of Y N y or n for a yes no question. I > > > put until $answer =~ m/YyNn/ that did not work. Anybody have > > > any solutions? > > > > the way you did it, would need to use or operator > > $answer =~ m/Y|y|N|n/ > > you probebly want to check if thats the only thing entred, > > > > $answer =~ m/^yn$/i > > > > ^ begins with, $ ends with, i is for case insensetive. > > That would work if the user entered the string "yn" (or "YN" or "Yn" or > "yN".) It should be either: > > $answer =~ m/^(?:y|n)$/i; > > Or: > > $answer =~ m/^(?i:y|n)$/; > > Or: > > $answer =~ m/^[yn]$/i; > > > John > -- > use Perl; > program > fulfillment > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]