in reply to Printing file to browser
Two things: are you using the -w flag, and is the file in the location you are expecting?
When I checked the code, I found that when the file existed in the current directory, I saw the whole thing, but when it didn't, all I saw what what you are seeing.
With the -w flag set, I got this message back when the file did not exist:
readline() on closed filehandle main::FILE at script.pl line 7.