darinlang has asked for the wisdom of the Perl Monks concerning the following question:

I have a simple script that I can't get to work on NT, it works fine on Linux, and Unix. Any idea why? The file exists in the same directory as the script, permissions are set to full-access, but it will not open the file.
print "Content-type: text/html\n\n"; open CONF_VIP, "VIP.txt" or die "Can't open config.txt. $!\n"; $vip = <CONF_VIP>; print "VIP is $vip\n";

Replies are listed 'Best First'.
Re: Linux to NT Open()
by dws (Chancellor) on Aug 07, 2002 at 03:20 UTC
    The file exists in the same directory as the script, permissions are set to full-access, but it will not open the file.

    For developement purposes only, add use CGI::Carp qw(fatalsToBrowser); to the top of your script. You should then see the error message (though note that you have the wrong filename in the die string).

Re: Linux to NT Open()
by weini (Friar) on Aug 07, 2002 at 04:53 UTC
    Hi,
    I guess your Webserver is not looking for your vip.txt-file in the same directory as your scripts is stored (probably \cgi-bin) but in the root-dir of the webpages (maybe \wwwroot).
    Try moving it there.

    HTH
    weini

    update: ... by the way: you get printed just the first line of the file (maybe you want @vip instead of $vip).