Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

[modperl]

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


ak at dasburo

Mar 9, 2000, 1:11 PM

Post #1 of 3 (928 views)
Permalink
[modperl]

Apache/Mod_Perl

hi,
just one thing i want to mention.

in a cgi script i do:
use CGI;
my $result = `./foo.pl a=b c=d`;

foo. pl looks like this:
use CGI;
my $q = new CGI (join '&', @ARGV);
print $q->param('a');

what happens is, that foo.pl won't execute because of:
error.log:
Can't locate object method "request" via package "Apache"


it works when i put the line
$CGI::MOD_PERL = 0;
into foo.pl



my httpd.conf:
<Files *.pl>
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
</Files>
--
+--------------------------------------------------------------------+
| Alexander Knack ........Entropie erfordert keine Wartung .........|
| dasburo.de ..................................................|
+--------------------------------------------------------------------+


cliff at genwax

Mar 9, 2000, 3:08 PM

Post #2 of 3 (866 views)
Permalink
Re: [modperl] [In reply to]

yes - you are calling foo.pl via a separate
process which of course is outside of mod_perl.

it is inheriting the environment however, so
it thinks it is running under mod_perl.

your fix is correct - but you probably do not
want to run a perl script using the backticks.

cliff rayman
genwax.com

Alexander Knack wrote:

> Apache/Mod_Perl
>
> hi,
> just one thing i want to mention.
>
> in a cgi script i do:
> use CGI;
> my $result = `./foo.pl a=b c=d`;
>
> foo. pl looks like this:
> use CGI;
> my $q = new CGI (join '&', @ARGV);
> print $q->param('a');
>
> what happens is, that foo.pl won't execute because of:
> error.log:
> Can't locate object method "request" via package "Apache"
>
> it works when i put the line
> $CGI::MOD_PERL = 0;
> into foo.pl
>
> my httpd.conf:
> <Files *.pl>
> SetHandler perl-script
> PerlHandler Apache::Registry
> Options ExecCGI
> </Files>
> --
> +--------------------------------------------------------------------+
> | Alexander Knack ........Entropie erfordert keine Wartung .........|
> | dasburo.de ..................................................|
> +--------------------------------------------------------------------+


dougm at pobox

Mar 14, 2000, 8:39 PM

Post #3 of 3 (860 views)
Permalink
Re: [modperl] [In reply to]

On Thu, 9 Mar 2000, Cliff Rayman wrote:

> yes - you are calling foo.pl via a separate
> process which of course is outside of mod_perl.
>
> it is inheriting the environment however, so
> it thinks it is running under mod_perl.

$ENV{MOD_PERL} is not inherited, if CGI.pm would check that instead of
$ENV{GATEWAY_INTERFACE}, that should fix the problem.
did anyone mention `` throws performance out the window?

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.