Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Require and INC

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello,
I'm using the cgi-lib.pl in scripts with the "require" statement.
This works fine in the default /cgi-bin directory.
(I'm using a standard IIS web hosting).

But the same scripts in another cgi-bin directory located in a sub-directory from root ( /my_soft/cgi-bin ) do not work (blank page is returned instead).

- A simple perl script without any "require" works fine, so it is not an execute access problem.
- The global INC array contains '.' (current directory)
- So What is wrong ?

I'm very confused about the way perl can find this included files.

Any Idea ?





 
Hi tibdub,

If you think cgi-lib.pl is the problem, find it and copy it to the same directory as your perl script. Perl will be able to find it in this way. However, I'm not entirely satisfied that cgi-lib.pl is the problem. In the past I have received a blank page, but if memory serves, I think it had to do with using DBD::pg and updateing a postgres table. It seems whenever a user had an apostropy in the input text box of a html form, it would cause the update to postgres table to fail with no hint as to what went wrong other that a blank html page.

I am in the process of changing all my scripts by eliminating the line "require cgi-lib.pl;" and substituting the following in its place:

use CGI qw( :all );
use CGI::Carp qw( fatalsToBrowser );

cig-lib.pl has been replaced by CGI.pm. When I did a search on my RedHat linux 7.3 box I did not find cgi-lib.pl other than in the cgi-bin directory where it was copied along with all my other perl scripts after I upgraded to RedHat Linux 7.3. The only dependencies my scripts had on cgi-lib.pl were to provide the html header and footer to any html embedded in the perl script, so it was a simple matter of changing the syntax that CGI.pm uses in place of the cgi-lib.pl syntax to provide html header and footer code.

Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
"I'm using a standard IIS web hosting"
im assuming your running windows

u can change the @INC paths
by adding a REG_SZ here
HKEY_LOCAL_MACHINE\SOFTWARE\PERLname the REG_SZ : lib
value is your full path

---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top