I have some CGI scripts on a Chinese Windows 2000 server running
IIS, with ActivePerl installed. 

I am able to read from files but not write. So the following
code, using CGI::Application:

sub register {

        my $self = shift;
        # Get CGI query object
        my $q = $self->query();

        my $output = $q->header;
        $output .= $q->start_html;
        $output .= $q->h1("HI ok there?");
        open (DB, "db") or die "No read from db: $!\n";
        while (<DB>) {
                $output .= $q->h2($_);
        }
        close DB;
        $output .= $q->h2(umask);
        $output .= $q->end_html();
        return $output;

returns the contents of db:

>    Content-Type: text/html; charset=ISO-8859-1
>                                               
>                                       HI ok there?
> 
> ok
> 
> not ok
> 
> test 1
> 
> test 2
> 
> test 3
> 
> test 4

But when I change 

        open (DB, "db") or die "No read from db: $!\n";

to 

        open (DB, ">db") or die "No write to db: $!\n";

I get this returned:

>                                                  Error in CGI Application
>                                                                               
>                              CGI Error                                        
> 
>    The specified CGI application misbehaved by not returning a
>    complete set of HTTP headers. The headers it did return are:
> 
> [Thu Jan 10 16:44:02 2002] D:\penpals CGI\Ppsite.pl: Error
> executing run mode 'mode2'.  Eval of code '$self->register'
> resulted in error: No write to db: Permission denied

I tried the umask function, but although it seemed to be setting
something it is not allowing me to write to the file. What is the
problem here? It looks to me like something which should have
been handled installing ActivePerl, but it is difficult for me
to do anything with the Windows machine or communicate with the
people responsible for it.

-- 
Greg Matheson                    To do is to be-- Descartes
Chinmin College                  To be is to do-- Voltaire
                                 Do be do be do-- Frank Sinatra
        (Anonymous - Men's Restrooms, Greasewood Flats, Scottsdale)
Taiwan Penpals Archive <URL: http://netcity.hinet.net/kurage>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to