Yes, I am running this as a cgi. I called it from a web browser. IE 6 on a
PC. Yes, the script has no Mac line endings. I wrote it on a PC using a text
editor. I've done nothing different than I have for all my other scripts. I
just don't understand. Here is the  path:

tonedeaf.redirectme.net/cgi-bin/write.cgi

The script is in the /Library/WebServer/CGI-Executables/ folder. I can get
other scripts to run fine, but just can't read or write files. Any ideas you
may have would be greatly appreciated.

Thanks,

Mark

----- Original Message ----- 
From: "Hannes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Mark Wheeler" <[EMAIL PROTECTED]>
Sent: Wednesday, September 24, 2003 8:35 AM
Subject: Re: File write/read problem


> On 9/24/03 6:37 AM, "Mark Wheeler" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > This is my first post to this group. Please forgive me if this is the
wrong
> > group for this question.
> >
> > I've been coding for a short time (a year or so) and love it. I've been
> > using other hosts for my scripts, and am now setting up my OSX server.
I've
> > run into a snag. I can't figure it out. When I try to read (or write,
for
> > that matter) to a file nothing happens. Below is an example script. If
the
> > file is there, nothing. If the files is not there, nothing. I get the
> > initial print statement about the file contents, but that's it. Is this
a
> > permissions problem? I've checked the permissions of the folder and it's
> > 775, everything looks good. What am I missing.
> >
> > Again, forgive me if this post is misplaced.
> >
> > Mark
> >
> > --------------------------
> > #!/usr/bin/perl -w
> >
> > use strict;
> >
> > print "Content-type: text/html\n\n";
> >
> > print "The contents of the file: <br><br>";
> >
> > open (DATA, "example.txt") || die ("Could not open file <br> $!");
> > my @text = <DATA>;
> > print @text;
> > close (DATA);
> >
> > exit;
> >
> > ---------------------------
>
> The above runs for me just fine (perl 5.8.0/ 10.2.8) from within bbedit.
> Since you get the initial statement - e.g. Part of your program are
actually
> run through the interpreter I assume that you've taken care of the path to
> perl and also made sure you got Unix and NOT Mac line breaks. You probably
> intend to run this as a cgi script - thus how did you actually run the
> script?
>
> /h
>

Reply via email to