How do we change / add new path to @Inc in window 2k environment

B

Bazil

I am trying to include a local file which contains sub-programs in a perl
file.

It fails with the following error:

Can't locate GM_Conn.pl in @INC (@INC contains: E:/Perl/lib E:/Perl/site/lib
..)

I am runing the server on a windows 2K server.

Documentations discuss changing @Inc in Unix/Linux environment but not for
Windows.

Can anyone help.

Regards
Bazil
 
B

Bob Walton

Bazil said:
I am trying to include a local file which contains sub-programs in a perl
file.

It fails with the following error:

Can't locate GM_Conn.pl in @INC (@INC contains: E:/Perl/lib E:/Perl/site/lib
.)

I am runing the server on a windows 2K server.

Documentations discuss changing @Inc in Unix/Linux environment but not for

NC----------------------------------^^

Case matters in Perl.


Windows. ....


Bazil

You should check out the "use lib" pragma. It should let you do what
you want to do in a portable fashion with not much hassle.
 
B

Bazil

require '\cgi-bin\gm_conn.pl';

I included full path in include statement now the error message changed to:

\cgi-bin\gm_conn.pl did not return a true value at
E:\Inetpub\Xitami\webpages\cgi-bin\gm-mailtk.pl line 3.

Any clues?

Thanks
 
P

Paul Lalli

All included files in Perl have to end with a true value. Put:

1;

as the very last line of your gm_conn.pl file.

Paul Lalli

Date: Mon, 5 Jan 2004 22:58:49 -0500
From: Bazil <[email protected]>
Newsgroups: comp.lang.perl.misc
Subject: Re: How do we change / add new path to @Inc in window 2k
environment

require '\cgi-bin\gm_conn.pl';

I included full path in include statement now the error message changed to:

\cgi-bin\gm_conn.pl did not return a true value at
E:\Inetpub\Xitami\webpages\cgi-bin\gm-mailtk.pl line 3.

Any clues?

Thanks
 
T

Tad McClellan

Bazil said:
\cgi-bin\gm_conn.pl did not return a true value at
E:\Inetpub\Xitami\webpages\cgi-bin\gm-mailtk.pl line 3.

Any clues?


Uhhh, arrange for /cgi-bin/gm_conn.pl to return a true value?


Did you lookup your error message in the Fine Documentation?

perldoc perldiag

%s did not return a true value
(F) A required (or used) file must return a true value
to indicate that it compiled correctly and ran its
initialization code correctly. It's traditional to
end such a file with a "1;", though any true value
would do. See "require" in perlfunc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top