Re: testing input/loops

2001-12-19 Thread Chris Zubrzycki
wow, thanks. this is the closest to what i wanted to do first, so i'll use this. > my $response = 0; > while ( $response != 1 and $response != 2 and $response != 3 ) { > print "What would like to do?\n"; > print "1. Start a new file\n"; > prin

RE: testing input/loops

2001-12-18 Thread Peter Cornelius
This doesn't do what you think it does. unless ($response eq '1' || '2' || '3') It says, unless the response was eq to 1, or if 2 is true, or if 3 is true. 2 and 3 are true by definition so this will always be true. I think you want unless ($response eq '1' or $r

Re: testing input/loops

2001-12-18 Thread Curtis Poe
--- Chris Zubrzycki <[EMAIL PROTECTED]> wrote: > Hey everybody. I have a simple problem that has been stumping me. I'm > using Perl 5.6.1 on Mac OS X 10.1.1. This is a sub for opening a file in > my program. this is the sub, and the problem is when i run it, if i do > not enter a number 1-3, it

RE: testing input/loops

2001-12-18 Thread McCollum, Frank
you have code at the bottom that tells it to loop back to the beginning if your response is not equal to a value between 1 and 3. So, it would continue to do this until you entered a valid value - or am I misunderstanding the question? > unless ($response eq '1' || '2' || '3') { >