in reply to While loop wont work

I made a few modifications. To my way of thinking, I'm going to use the script to print out a "filename"; hence, you don't really need 'yes' or 'no'. If something comes up, and the user has to scram, then just use a 'q' for 'quit'. Here's what I would do:
#!/usr/bin/perl -l use strict; use warnings; $|=1; my $filename = ''; until ($filename eq 'q') { print "Enter a filename"; chomp ( $filename = <STDIN> ); }
This will print filenames until you tell it to quit, but how you want to print those files, I'll leave it up to you.