3:43pm, Mary Anderson wrote:


Hi All,

  I am running Perl 5.8.7 (ActivePerl) on a Windows XP platform.  I have
been unable to open files from a CGI.pm script.  Here is the offending code:


use CGI qw/:standard :html3 :netscape/;
use POSIX 'strftime';
use CGI::Carp('carpout');
open(LOG,">>.\guestbook.err")||
        die "couldn't open log. $!";

Here is the error message:

guestbook.pl: couldn't open log. Permission denied at
                                   ^^^^^^^^^^^^^^^^^
c:\inetpub\wwwroot\cgi-bin\guestbook.pl line 5

I have tried full path names with forward and backwards slashes.  Sigh, if
only I were in UNIX, the error message would be sensible and useful!

It looks like the error message is sensible and useful. While we Unix folk tend to forget, Windows does have a mechanism for file permissions, and that's exactly what your script is complaining about. This is the #1 common problem with CGI scripts: the web server runs as an unpriviledged user that can't read or write some file that the developer, when running the script from the command line, can.


The same piece of code works ok in a .pl script without CGI.

Any help is appreciated!

Mary Anderson

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>





--------------------------------------------------------------
"Football is a mistake. It combines the two worst elements of
American life: violence and committee meetings." --George Will
--------------------------------------------------------------

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to