Perl question +saving to another directory

dasoldier

Limp Gawd
Joined
Apr 29, 2005
Messages
185
I am wanting my perl script to save the results of a form to another directory (not located in the cgi-bin folder. I'd like to save the results as a .txt file or .html but anytime I try to have the script save the results in another folder it stops working. It seems like such an easy task I just can't get it to work so thought I should ask. I am wanting the results to be viewable from a web browser, nothing to fancy.

This Works (saves results to the cgi-bin folder)
#save form data to a file
open(OUTFILE, ">>", "survey.txt")
or die "Error opening survey.txt. $!, stopped";
print OUTFILE "$game, $commercial\n";
close(OUTFILE);

This does not :(
#save form data to a file
open(OUTFILE, ">>", "/public_html/survey.txt")
or die "Error opening survey.txt. $!, stopped";
print OUTFILE "$game, $commercial\n";
close(OUTFILE);
 
Are you sure there is a /public_html and not something like /~web_user/public_html? That is, are you trying to access files by their URL location and not their actual position on the filesystem?
 
Back
Top