in reply to Need to print file contents on page
Please edit your post and wrap your code in code tags (<code> your code
goes here </code>) to get:
your code goes here
Now on to your question: The biggest problem I see in your code is that you're not bothering to check the results of the open call. I suggest you do something like:
open my $DF, '<', $file; if (! defined $DF) { print "Cannot open file '$file' because: $!"; } else { while (my line = <$DF>) { print $line; } close $DF; }
This way, you can get an error message that may provide you some hints as to what the actual problem is.
I suspect that:
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|