I have a problem that I have tried to get to work. First, I wrote a PERL Script a long time ago and it is on another server. We are creating a new server, and I have downloaded/installed Strawberry PERL 64-bit. I am now checking all of my PERL scripts to make sure all work on the new server.
I converted a script to the new way Strawberry wants (use of require to use another file in-line), but I just can't get past the following error: permission denied to open file for writing.
I start will a shell program that calls the inline file:
require "cgi/cr/main_test.pl";
This array hold the text files that will be run through:
my @main = ("BOOKS","CDs","DVDs","VIDEOS","PERIODICALS","VIDEO-GAMES","TOYS","RECORDED-BOOKS","BINS");
The require calls a program to open files for writing results, and then goes through each text file and display and add the numbers in each file.
#!/usr/bin/perl -w
my $recFnd = "C:\\inetpub\\wwwroot\\cgi-bin\\CustomerRelations\\recs_found.txt";
chmod 0755, $recFnd;
print "<p>$recFnd</p>";
open (my $newloc, '>', $recFnd) or die "Couldn't open: $!";
The above is $recFnd opens a text file that will be written any code that is found (I have a file that has all of the codes. I use the data from both to find any new codes that have been used.). One the next line I change file permission, but that is just passed by (may work, but I cannot test since this is a windows environment). Then I print the location 7 name of the file to be sure it has the correct file. Finally, the open where I have tried every version I could to get this to work. Originally the code for opening the file as:
open (NEWLOC, "> recs_found.txt ") || die;
No matter what I do, I get a permission error. The folder the files for writing is in has everyone in the building Full Control. I am not sure what I can do.
If anyone can help, it would be very appreciated.