I wrote a perl/CGI program that opens a file and performs a search function, returning all entries that contain the specified word. I put it in the cgi-bin. I keep getting an error though that the file can't be opened. I used open(FH, "/filename") to access the files which I had put in the cgi-bin also. I was wondering where I need to put the files in order to access them or what the current directory is for programs located in the cgi-bin. If anyone could help out it would be greatly appreciated. Thanks, Stacy
Can you post your code? In general, Perl likes physical path. Look up your physical path in the control panel -> account information section quote:Originally posted by FEGator I wrote a perl/CGI program that opens a file and performs a search function, returning all entries that contain the specified word. I put it in the cgi-bin. I keep getting an error though that the file can't be opened. I used open(FH, "/filename") to access the files which I had put in the cgi-bin also. I was wondering where I need to put the files in order to access them or what the current directory is for programs located in the cgi-bin. If anyone could help out it would be greatly appreciated. Thanks, Stacy </blockquote id="quote"></font id="quote">
that's probably it. Try use the physical path, like e:\web\blah\blah\fefiles\Distribution.csv.txt. You can find the exact path to your root in the account information section in the control panel. quote:Originally posted by FEGator if($fileref == 0) { open(IFH, "/FEfiles/Distribution.csv.txt") || die "cannot open file: $! \n"; } elsif($fileref == 1) { open(IFH, "/FEfiles/Contacts.csv.txt") || die "cannot open file: $! \n"; } These are the open functions. The fileref is passed in from an HTML page. FEfiles is the directory that I have the files (comma delimited) in. The code just goes on to search the opened file. The error message I keep getting though is "cannot open file: no such file or directory" </blockquote id="quote"></font id="quote">
if($fileref == 0) { open(IFH, "/FEfiles/Distribution.csv.txt") || die "cannot open file: $! \n"; } elsif($fileref == 1) { open(IFH, "/FEfiles/Contacts.csv.txt") || die "cannot open file: $! \n"; } These are the open functions. The fileref is passed in from an HTML page. FEfiles is the directory that I have the files (comma delimited) in. The code just goes on to search the opened file. The error message I keep getting though is "cannot open file: no such file or directory"
try use \\ for quote:Originally posted by FEGator OK I entered the physical path and now I am getting an error that reads: Unrecognized escape \w passed through at E:\web\fieldengnet\htdocs\cgi-bin\FEprojecttest.cgi There are other errors that read the same but for \h, \F, and \D. Are there restrictions that I need to specify, or what can I do to correct this? Thanks. </blockquote id="quote"></font id="quote">
OK I entered the physical path and now I am getting an error that reads: Unrecognized escape \w passed through at E:\web\fieldengnet\htdocs\cgi-bin\FEprojecttest.cgi There are other errors that read the same but for \h, \F, and \D. Are there restrictions that I need to specify, or what can I do to correct this? Thanks.