newtoperl1993 has asked for the wisdom of the Perl Monks concerning the following question:
Anyone any ideas why this while loop wont work?
while (open(MYFILE, "$filename") == 0) { printf("Cannot open file for reading"); printf("\n\nDo you wish to enter a new file?: "); $choice = <>; if ($choice eq "no") { die("Program ending"); } if ($choice eq "yes") { print("Enter the name of the file you wish to print: "); $filename = <>; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: While loop wont work
by davido (Cardinal) on Dec 21, 2011 at 00:17 UTC | |
|
Re: While loop wont work
by JavaFan (Canon) on Dec 20, 2011 at 21:17 UTC | |
|
Re: While loop wont work
by choroba (Cardinal) on Dec 20, 2011 at 21:16 UTC | |
|
Re: While loop wont work
by Khen1950fx (Canon) on Dec 21, 2011 at 04:13 UTC | |
|
Re: While loop wont work
by TJPride (Pilgrim) on Dec 21, 2011 at 05:36 UTC |