First, check that you're using strict and -w. I think you're getting errors that you can't see. In that case, check your log file.
Second, the way this operates depends a lot on how you're calling it. If you're opening a pipe, it could break, and then things could fall apart.
I have a sneaking suspicion, though, that you're doing something like this:
my $file = "foo.txt";
my $data;
read($file, $data, 1024);
Note that read operates on a file-handle, not a file name. These need to be opened:
my $file = "foo.txt";
open ($fh, $file) || die "Could not open file $file\n";
my $data;
read($fh, $data, 1024);
If you're feeling more progressive, you might try and use IO::Handle instead of the read anachronism. | [reply] [d/l] [select] |
| [reply] |
| [reply] |
On the page? Do you mean you're running a CGI script? In that case, use CGI::Carp 'fatalsToBrowser'; will help you see any errors that will otherwise onlyl show up in the server's logs. Be sure however to drop the 'fatalsToBrowser' option once you're script is actually running on the production server.
For a good intro to the topic of CGI scripts, see Ovid's excellent CGI course.
Makeshifts last the longest.
| [reply] |