--- 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 keeps asking me forever to enter a number. > Even if I enter a number 1-3 after the first run, it keeps asking me to > enter a number. > > Thanks for all the help you guys have been giving to everyone, I have > learned much. > > sub start { 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"; print "2. Append to a file\n"; print "3. Close a file\n"; print "Enter a number: "; chomp($response=<STDIN>); } > if ( $response eq '1' ) { [snip]
Cheers, Curtis "Ovid" Poe ===== Senior Programmer Onsite! Technology (http://www.onsitetech.com/) "Ovid" on http://www.perlmonks.org/ __________________________________________________ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]