in reply to While loop wont work

use strict; use warnings; my $file; while (1) { while (1) { print "Please enter a file name, or Q to quit.\n"; chomp($file = <STDIN>); exit if uc $file eq 'Q'; last if $file; } last if open(FH, $file); print "Can't open $file for read.\n"; } print join '', <FH>; exit;

FYI - I'm sure this is a homework assignment of some sort, but if you're curious, you -can- print out a file to the screen with the 'cat' command if you're on the Unix or Mac command line. The 'type' command does something similar on Windows, supposedly.