P is for Practical | |
PerlMonks |
Slightly OT: Perl and CGI - reading a fileby C_T (Scribe) |
on Mar 30, 2004 at 23:37 UTC ( [id://341140]=perlquestion: print w/replies, xml ) | Need Help?? |
C_T has asked for the wisdom of the Perl Monks concerning the following question:
In my recent Perl class we constructed a Perl/CGI script that read a list of produce items from a text file, then used those items to make a web order form. This code ran perfectly on the class Unix server.
Now I've returned home and I uploaded the same script and the same text file to my website's server. Now when I run the script it fails with an error: Error opening produce_items.txt! : No such file or directory at /html/cgi/eproduce.cgi line 24. First of all, here's the code I'm using:
Someone suggested trying the full pathname, so I amended the code as follows:
This fails with the same error (well, slightly different... it says "/produce_items.txt" instead of "produce_items.txt"). The text file is in the same directory as the cgi file, by the way. I know this is a CGI problem, not a Perl problem, but perhaps someone more experienced than I can see what I'm doing wrong? Many thanks!
Charles Thomas Madison, WI
Back to
Seekers of Perl Wisdom
|
|