require

Shaughnessy, Ian Ian_Shaughnessy at NAI.com
Wed Aug 15 05:36:19 CDT 2001


What webserver are you running?  And generally crawling around doesnt make a
webserver too happy.. it runs as the user nobody (I'm assuming), so if it
tries to enter a directory that does not have rwxr-xr-x permissions, it
cant.  Try this:

su nobody
cd /www/karic/clientone
./coolapp.cgi

Check the output.  I'm pretty sure youre going to see perl spit back a
permissions problem.  This is just a handy way of debugging a cgi script
too, heh, you dont know how many times I've had a script not work because of
a permissions problem that I didnt realize until I executed it as manually
as user nobody (or whatever user the webserver runs as).

Also, in case you havent used require much... make sure the require'd file
ends with a '1;'.  Otherwise require dumps to an error (has to do with
return values).  I think its silly, but I guess I'm not Alan Cox.  ;)  

 -Ian

-----Original Message-----
From: Kari Chisholm
To: Portland Perl Mongers
Sent: 8/14/01 5:21 PM
Subject: require


Howdy all--

This may be a moron question, but I can't seem to get it to work.

I've got two CGI's

	http://www.clientone.com/coolapp.cgi
	http://www.clienttwo.com/coolapp.cgi

that really live on my server here

	/www/karic/clientone/coolapp.cgi
	/www/karic/clienttwo/coolapp.cgi

I want each of them to read in subroutines and settings from a single
place

	/www/karic/mystuff/global.cgi

So, in each of those two cgi's I've got this line

	require ("/www/karic/mystuff/global.cgi");

I can't find any documentation that says I can crawl around my file
server like
this using require, but nothing that says I can't either.

Nonetheless, I'm getting a server error.  Is this a problem with my
perl, or
with my server?

Any thoughts?

-kari.

p.s. I couldn't get it to work with DO or USE either, though I know much
less
about those.
TIMTOWTDI
TIMTOWTDI



More information about the Pdx-pm-list mailing list