in reply to Re: Re: Opening files problem
in thread Opening files problem

This part of your code:
$line = <FILENAME>; while ($line ne "") { print "$line<BR>"; $line = <FILENAME>; }
is more commonly expressed like this in perl:
while (<FILENAME>) { print "<BR> $_"; }

but I'm sure this has nothing to do with the problem you're having. The earlier advice about printing "$!" in the "Booger" message will help.

It is possible that the cgi script is running with something other than "c:\Inetpub\wwwroot\CGI-BIN" as its current working directory (eg. it may be using wwwroot instead), so you might want to figure out how to determine the cwd, and include that info in the "booger" message (this would be "$ENV{PWD}" on unix, but I'm not sure if that ports to Windows) -- or maybe just experiment with opening "CGI-BIN\data.txt" to see if that works; certainly, if you use the full path name in the open statement, that should do it.

Replies are listed 'Best First'.
Re: Re: Re: Re: Opening files problem
by mojobozo (Monk) on Jul 31, 2002 at 11:27 UTC
    SUCCESS!!

    graff was correct. I stuck in the $! on the print "Booger" and it told me that the file did not exist. Strange I thought, it's right there in the directory. So I moved a copy to the wwwroot and BINGO! Thanks for your help everyone. Not only am I learning Perl, but Windoze servers as well.

    Happy crunching!