Hi, this is my first post so please excuse any mistakes!
I'd like to write files using an upload script in my website, but I'm having problems. I don't seem to be able to write a file. Ive set up the following script to test this. It first reads a file successfully, then tries to write a file in the same directory. When run, the script stops at the line to open the file for writing without any errors. The permissions on the directory are 707, so I don't think this is the problem. Can anyone help me?
(www.thetimeband.com/cgi-bin/upload_file.cgi)
#!/usr/bin/perl -wT
use strict;
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use lib '.';
use timebandweb;
my $testread = $ENV{'DOCUMENT_ROOT'}."/misc/test.txt";
my $testwrite = $ENV{'DOCUMENT_ROOT'}."/misc/test1.txt";
timeband_header("testing");
timeband_wrapper_start();
print "Attempting to read $testread<br>\n";
open READFILE, "< $testread" or die "Unable to open $testread: $!\n";
while (<READFILE>) {
print "$_<br>\n";
}
close READFILE;
print "Attempting to write $testwrite<br>\n";
open WRITEFILE, "> $testwrite" or die "Unable to open $testwrite: $!\n";
print WRITEFILE "It worked...\n";
close WRITEFILE;
print "All done<br>\n";
timeband_wrapper_end();
timeband_footer();