This is a discussion on Apache: Perl's @INC as seen by CGI script? within the Linux Web Servers forums, part of the Web Server and Related Forums category; This is a question about Apache and the Perl variable @INC. A CGI script, when it is run in the &...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
This is a question about Apache and the Perl variable @INC. A CGI script, when it is run in the "usual" way (i.e. some usually remote client requests it through some server), generally sees a different environment from what the same script would see if one were to run it locally via the command line. Therefore, the results of the local command % perl -le 'print "@INC"' most likely would not reflect the Perl variable @INC that a CGI script actually sees during usual operation. One way to get the desired @INC would be to write a brief CGI script that prints out "@INC", and point one's browser to this script. But is there a direct way to get the same information locally from the (Apache) webserver? Thank you much! -bill |
|
|||
|
On Wed, 26 May 2004 19:46:36 +0000 (UTC), bill <please_post@nomail.edu> wrote:
> > This is a question about Apache and the Perl variable @INC. > > A CGI script, when it is run in the "usual" way (i.e. some usually > remote client requests it through some server), generally sees a > different environment from what the same script would see if one were > to run it locally via the command line. Therefore, the results of the > local command > > % perl -le 'print "@INC"' > > most likely would not reflect the Perl variable @INC that a CGI > script actually sees during usual operation. > > One way to get the desired @INC would be to write a brief CGI script > that prints out "@INC", and point one's browser to this script. > > But is there a direct way to get the same information locally from > the (Apache) webserver? Probably IF you can log onto the actual apache server. What might not be apparent is that your web directories may be remote mounted on it, and you may not have login access to the apache box itself. We ran into something like that when my ISP added a newer version of Perl at /usr/bin/perl (with older version at /usr/local/bin/perl) and we compiled SpamAssassin to use that Perl (/usr/bin/perl Makefile.PL ...). SpamAssassin running in our home dir remote mounted on smtp server would not work for actual mail, until newer Perl was added to the smtp server. -- David Efflandt - All spam ignored http://www.de-srv.com/ |
|
|||
|
On Wed, 26 May 2004 19:46:36 +0000 (UTC), bill <please_post@nomail.edu>
wrote: > > This is a question about Apache and the Perl variable @INC. > > A CGI script, when it is run in the "usual" way (i.e. some usually > remote client requests it through some server), generally sees a > different environment from what the same script would see if one were > to run it locally via the command line. Therefore, the results of the > local command > > % perl -le 'print "@INC"' > > most likely would not reflect the Perl variable @INC that a CGI > script actually sees during usual operation. > > One way to get the desired @INC would be to write a brief CGI script > that prints out "@INC", and point one's browser to this script. > > But is there a direct way to get the same information locally from > the (Apache) webserver? If you have your server set up to use the perl-status module part of mod_perl, you can use: http://yourserver.com/perl-status?inc and @INC appears at the bottom of the page. Otherwise, try this CGI script (untested): #!/usr/bin/perl $inc = join( "\n", @INC ); print "Status: 200\nContent-type: text/plain\n\n$inc"; -- Dan Wilga dwilga-MUNGE@mtholyoke.edu ** Remove the -MUNGE in my address to reply ** |