PDA

View Full Version : probably a dumb script question


chrisboy
07-29-2001, 08:29 PM
so i've got a plain old sample script working in my brand new account with futurequest:
http://www.chrisboy.com/cgi-bin/hello.pl

but i just moved some other scripts from another server, and they all seem to be choking on the fact that they require cgi-lib.pl, which i believe i have installed correctly in my cgi-bin...

is this correct usage in a script on futurequest's servers? (if the script calling cgi-lib.pl is in the same place (cgi-bin) as cgi-lib.pl?)
- -
require "cgi-lib.pl";
- -

cgi-lib.pl has permissions set to 755, so does the script that is calling it -
http://www.chrisboy.com/cgi-bin/val.pl
which is used by this silly form:
http://www.chrisboy.com/validate.html

my error logs say there is an error in the line where i require cgi-lib.pl in val.pl

any ideas? i know this is a bit vague, but maybe this is some sort of common problem?

thanks.

-chris

Bob
07-29-2001, 09:03 PM
Hi Chris,

Welcome to FutureQuest:)

You may wish to start trying to trouble shoot this by visiting your CNC's troubleshooting area and checking your installed scripts then possibly viewing your error logs and between the two you may be able to determine where the problem lies.

Hope this helps,
Bob

chrisboy
07-30-2001, 06:25 AM
hi bob-

thanks for your quick response.

i have already run both scripts through the checker, and they pass everything.

the only error in my logs says::
cgi-lib.pl did not return a true value at val.pl line 8.

line 8 in val.pl is simply:
require "cgi-lib.pl";

so the problem definitely seems to be with how i am calling or implementing the library cgi-lib.pl - do you know if there are any restrictions on implementing perl libraries? or maybe do i need to use the full path in the "require" line?

thanks again.

-chris

chrisboy
07-30-2001, 08:02 AM
d'oh! i was missing the final line of "1;" in my cgi-lib.pl script. (hence the "must return true value" error.)

must have gotten chopped when i was cutting and pasting to transfer the script from another server. weird.

anyway, it is solved.

thanks.

-cy

Terra
07-30-2001, 08:08 AM
Since you have not defined 'where' that library is at - perl will walk it's @INC (include) array looking for it...

Try this instead: './cgi-lib.pl'

You may also have to monkey around with the @INC array, or possibly use the 'use lib' pragma...

http://wizard.dvia.com/perlbooks/COOKBOOK/CH12_08.HTM

:)

--
Terra
sysAdmin
FutureQuest

Terra
07-30-2001, 08:12 AM
Then again, lobbing a grenade at a problem rarely ever works...

Without a whole lot of info, the resolve prior was the next logical choice to look for...

It did not occur to me that the '1' ommision would have been bungling the actual library...

--
Terra
sysAdmin
FutureQuest

chrisboy
07-30-2001, 08:24 AM
thanks for the advice. i will research the path idea a little more for future reference...

-cy