Mod_perl woes

C

Carl Cunningham

Hi folks,

I'm having a devil of a time with something that should be very easy. I'm
using mod_perl and CGI::Application for some pokey stuff, and my scripts run
just dandy in a CGI environment, but outputs absolutely nothing in my
mod_perl setup.

I'm using:
MacOSX 10.3
Perl 5.8.1 (the standard delivered version)
Mod_perl 1.26 (the standard delivered version)
Apache 1.3.28 (the standard delivered version)

perl -MApache -e 'print $Apache::VERSION' = 1.27
perl -Mmod_perl -e 'print $mod_perl::VERSION' = 1.26
perl -MCGI -e 'print $CGI::VERSION' = 3.00

Here's my Apache::Registry Configuration out of the httd.conf
PerlModule Apache::Registry
<Location /registry>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>

Now this is where it gets weird. Following script works dandy:
my $r = Apache->request;
$r->content_type("text/html");
$r->send_http_header;
$r->print("Hi There!");

But this script only generates output in a CGI environment:
use strict ;
use CGI ;
my($q) = new CGI ;
print $q->header,
$q->start_html('hello world'),
$q->h1('hello world'),
$q->end_html;


????
 
D

Default

But this script only generates output in a CGI environment:



????
well im not sure as ive never made a cgi.

use CGI qw:)standard);

that could be the thing you need for that. its something called 'import tags'.
 
T

Tassilo v. Parseval

Also sprach Default@IO_Error_1011101.xyz:
well im not sure as ive never made a cgi.

use CGI qw:)standard);

that could be the thing you need for that. its something called 'import tags'.

That's a bit of a wild guess. Import tags bundle up a number of
functions (or more generally: symbols) so that they can be imported in
one go. The OP however doesn't use the function-oriented interface of
CGI.pm. He chose the object-oriented approach which makes importing
obsolete.

Therefore, this is very probably not the cause for his problems.

Tassilo
 
C

Carl Cunningham

in Beitrag [email protected] schrieb Tassilo v. Parseval
unter (e-mail address removed) am 24.11.2003 9:39 Uhr:

The OP however doesn't use the function-oriented interface of
CGI.pm. He chose the object-oriented approach which makes importing
obsolete.

Therefore, this is very probably not the cause for his problems.

I've had plain vanilla scripts with CGI.pm running under mod_perl (Registry)
before, and I don't seem to remember any kind of problems with that
combination. I'm thinking that I may have some funky installation conflicts,
but I'd like to rule out stupid mistakes on my side ("operator headspace and
timing") before I start to disembowel my installation.
 
D

Default

Also sprach Default@IO_Error_1011101.xyz:
That's a bit of a wild guess. Import tags bundle up a number of
functions (or more generally: symbols) so that they can be imported in
one go. The OP however doesn't use the function-oriented interface of
CGI.pm. He chose the object-oriented approach which makes importing
obsolete.

Therefore, this is very probably not the cause for his problems.

Tassilo
nod you are most likely right, i did a bit of testing on the code itself.

C:\Perl>type testcgi.plx
use strict ;
use CGI ;
my($q) = new CGI ;
print $q->header,
$q->start_html('hello world'),
$q->h1('hello world'),
$q->end_html;

C:\Perl>testcgi.plx >testcgi.html

C:\Perl>

then i opened testcgi.html in a browser and it worked fine.
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top