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 = <>; } }