#!/usr/bin/perl use strict; print "Content-Type: text/html\r\n\r\n"; print "\n"; print "\n"; print "\n"; print "\n"; my $filename ="/var/www/html/DATA/kk.txt"; open(KK,">$filename"); close(KK); # this line and the next 2 were not part of system("chmod 666 $filename"); # of the original code. They were added to open(KK,">>$filename"); # see if changing the permissions would help print "we are trying to write\n"; print KK "we are trying to write\n"; close(KK); print "\n"; print "\n";