Perl CGI and NT 
Author Message
 Perl CGI and NT

I"ve been running into some problems running some CGI scripts written in
Perl on a particular NT server and not sure what I'm doing wrong..getting
them to run on Unix is a snap, but can someone clarify this.

When specifying an absolute path back to a directory, should you

A: take the path back from the drive such as
c:/inetpub/wwroot/mydirectory/otherdirectory
B: path from the script ../otherdirectory (assuming script is in cgi-bin)

or should I be using \ instead of / in the directory path

I know this may be a really (I hope) elementary question, or not enough
info, but I'm new at running scripts on NT servers and am begrudgingly
keeping this site on an NT server instead of moving it over to a UNIX box
where things would be so much more straightforward.



Thu, 29 Nov 2001 03:00:00 GMT  
 Perl CGI and NT

Quote:

> I"ve been running into some problems running some CGI scripts written in
> Perl on a particular NT server and not sure what I'm doing wrong..getting
> them to run on Unix is a snap, but can someone clarify this.

> When specifying an absolute path back to a directory, should you

You should do the same thing that you do when your program isn't written
in Perl. Check with the docs, FAQs, and newsgroups about CGI programming
for more information. But, since you asked...

Quote:
> B: path from the script ../otherdirectory (assuming script is in
> cgi-bin)

You not only can't assume that, you can't assume that your working
directory is going to be the cgi-bin directory or the directory that the
script is in. On some servers, it's one, on some the other. On some, it's
another directory entirely, since the working directory is not part of the
CGI spec.

Quote:
> or should I be using \ instead of / in the directory path

No, you can use forward slashes from Perl on Windows-type machines. But
you'll need to find the directory some other way than using relative
pathnames. At least, until you chdir to some fixed directory. The docs,
FAQs, and newsgroups about CGI programming and servers should be of help.

Cheers!

--
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



Thu, 29 Nov 2001 03:00:00 GMT  
 Perl CGI and NT

Quote:
> I"ve been running into some problems running some CGI scripts written in
> Perl on a particular NT server and not sure what I'm doing wrong..getting
> them to run on Unix is a snap, but can someone clarify this.

> When specifying an absolute path back to a directory, should you

> A: take the path back from the drive such as
> c:/inetpub/wwroot/mydirectory/otherdirectory
> B: path from the script ../otherdirectory (assuming script is in cgi-bin)

> or should I be using \ instead of / in the directory path

> I know this may be a really (I hope) elementary question, or not enough
> info, but I'm new at running scripts on NT servers and am begrudgingly
> keeping this site on an NT server instead of moving it over to a UNIX box
> where things would be so much more straightforward.

I use NT and it works OK with absolute real paths.. remember the script is
called from the server itself.  The relative path may change (probably does)
from site to site anyway.

I prefer to use backwacked backwacks but \\ because I double quotes (to
enable variables in the path name) but / seems to work just as well...

so.. take the path fully from the drive letter.

Wyzelli



Fri, 30 Nov 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Use PERLIT for Perl CGI from NT Netscape Web Server

2. New Perl/CGI programmer / NT

3. Using perl CGI under NT

4. killing a perl CGI on NT

5. Perl CGI on NT error

6. How to run Perl/CGI under NT?

7. How to run Perl cgi on Nt Server ?

8. perl cgi on NT

9. simple tutorial on writing perl cgi for NT

10. cookies in perl cgi on NT

11. New Perl/CGI programmer / NT

12. perl/cgi/apache/NT

 

 
Powered by phpBB® Forum Software