paddytsr
asked on
opening a file problem
i try to open a file in a perl script and this works...
open FILE,'<correct.txt' or die "can't open correct.txt because $!";
however when i pass the scipt the value 1.txt as a QUERY_STRING
like this
<a href="http://....cgi-bin/test.cgi?1.txt>click here</a>
and try....
open FILE,'</data/local/apache/ htdocs/ans wers/$ENV{ QUERY_STRI NG}' or die "can't
open /data/local/apache/htdocs/ answers/$E NV{QUERY_S TRING} because $!";
it wont work!!!
the error it reports is
can't open /data/local/apache/htdocs/ answers/29 1119991.tx t because No such file
or directory at /usr/local/apache/cgi-bin/ test.cgi line 46, <FILE> chunk 1
but the file is there and i have done chmod correctly (as far as i know)
can anyone help?
paddy
open FILE,'<correct.txt' or die "can't open correct.txt because $!";
however when i pass the scipt the value 1.txt as a QUERY_STRING
like this
<a href="http://....cgi-bin/test.cgi?1.txt>click here</a>
and try....
open FILE,'</data/local/apache/
open /data/local/apache/htdocs/
it wont work!!!
the error it reports is
can't open /data/local/apache/htdocs/
or directory at /usr/local/apache/cgi-bin/
but the file is there and i have done chmod correctly (as far as i know)
can anyone help?
paddy
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Rocca - Seeing you're not vey customed to Experts Exchange you might want to read the rules first.
It's uncustom and very inconvenient to answer a question rather than just supply your comment. You say it's 'possibly' an answer so why post it as one? Comments can be accepted as answers so you don't have to be afraid of losing out.
Besides that, prematurely answering will take the question away from other experts to have a look at as it's status will be locked.
It's uncustom and very inconvenient to answer a question rather than just supply your comment. You say it's 'possibly' an answer so why post it as one? Comments can be accepted as answers so you don't have to be afraid of losing out.
Besides that, prematurely answering will take the question away from other experts to have a look at as it's status will be locked.
ASKER
binkzz got there first
hes right about locking up questions with answers too
thanks binkzz
hes right about locking up questions with answers too
thanks binkzz
Binkzz - thanks.
chomp $ENV{QUERY_STRING};
open FILE,'</data/local/apache/
open /data/local/apache/htdocs/
....or optionally what binkzz said should work too.