Re: cannot open and write file
From: A. Sinan Unur (1usa_at_llenroc.ude.invalid)
Date: 01/21/05
- Next message: PerlFAQ Server: "FAQ 4.28 How do I change the Nth occurrence of something?"
- Previous message: Matt Garrish: "Re: cannot open and write file"
- In reply to: Roll: "cannot open and write file"
- Next in thread: Roll: "Re: cannot open and write file"
- Reply: Roll: "Re: cannot open and write file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 21 Jan 2005 04:37:46 GMT
"Roll" <lie_huo@hotmail.com> wrote in
news:5b06d7c84f17e758419955dab21b8b78
@localhost.talkaboutprogramming.com:
> i want to try writing to a file. i try this coding
> <write.cgi>
> #!/usr/bin/perl
> open(OUTF,">>/root/a.conf");
> print OUTF "anc";
> close OUTF
>
> but when i open this page using a web browser, it give me an error
> 403?? can anyone tell me y is this so did i miss some coding or it
> should be written in another way?
The fact that you get a 403 status code means your script did not even
run (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html).
Even then, your script does not seem to be a CGI script. Try the
following:
#! /usr/bin/perl
use strict;
use warnings;
use CGI;
print header,
start_html,
p('Hello World'),
end_html;
__END__
To see if you have set up your web server correctly.
I find that highly unlikely given that you seem to want to give the
whole wide world write access to root's home directory.
Note that your question at this point is not really a Perl question.
Questions that are solely about CGI your web server set up should be
directed to the relevant fora.
You may also benefit from reading:
perldoc -q 500
Sinan.
- Next message: PerlFAQ Server: "FAQ 4.28 How do I change the Nth occurrence of something?"
- Previous message: Matt Garrish: "Re: cannot open and write file"
- In reply to: Roll: "cannot open and write file"
- Next in thread: Roll: "Re: cannot open and write file"
- Reply: Roll: "Re: cannot open and write file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|