How to test @INC as seen by CGI script?

B

bill

Is there a simple way to test the @INC seen by one's CGI script,
other than writing a CGI script that serves @INC out on a page,
and visiting that page with a browser?

Thank you very much,

-bill
 
G

Gunnar Hjalmarsson

bill said:
Is there a simple way to test the @INC seen by one's CGI script,
other than writing a CGI script that serves @INC out on a page, and
visiting that page with a browser?

Not sure what you mean ... You can of course have a CGI script print it:

#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "$_\n" for @INC;
 
H

Herr Hardy

Is there a simple way to test the @INC seen by one's CGI script,
other than writing a CGI script that serves @INC out on a page,
and visiting that page with a browser?

Something like (Depending on OS)

BEGIN{
die if(!-e '/home2/xampp/perl/lib/');
}

???

Hardy
 
G

gnari

bill said:
Is there a simple way to test the @INC seen by one's CGI script,
other than writing a CGI script that serves @INC out on a page,
and visiting that page with a browser?

you mean like perl -le'print "@INC"' ?

of course, if there are more than one perls installed on your
system, or your server uses a statically linked perl, or does
things to your CGI script's environment, the method you mention
may be safer. (and what is wrong with that, by the way?)

gnari
 
J

Joe Smith

bill said:
Is there a simple way to test the @INC seen by one's CGI script,

Yes, by writing a small CGI script that outputs the contents of
@INC after sending a "Content-type: text/plain\n" header.
other than writing a CGI script that serves @INC out on a page,
and visiting that page with a browser?

The way to tell what the server is providing to
CGI scripts is to actually run one.
-Joe
 

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
474,156
Messages
2,570,878
Members
47,404
Latest member
PerryRutt

Latest Threads

Top