[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mod_perl and CGI::Application.. Strange Behaviour
- Subject: Re: mod_perl and CGI::Application.. Strange Behaviour
- Date: Sat, 27 Oct 2007 14:06:32 +0100 (BST)
- From: Anthony Gardner <suppressed>
Dileep, sorry for the delay in answering but I had to do fresh installs after a recent ubuntu upgrade.
Okay, with a fresh, default Apache2/MP2 install (from source) I can easily print using CGI::Application
<Directory "/opt/httpd/cgi-bin">
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
AllowOverride None
##Options None
Order allow,deny
Allow from all
</Directory>
#!/usr/bin/perl
use strict;
use lib '/opt/httpd/cgi-bin';
use MyTest;
my $app = MyTest->new();
$app->run()
package MyTest;
use strict;
use base 'CGI::Application';
sub setup {
my $self = shift;
$self->start_mode('mode1');
$self->run_modes( 'mode1' =>
'greet',);
}
sub greet {
my $self = shift;
my $q = $self->query();
my $output = '';
$output .= $q->start_html(-title => 'MyTest');
foreach my $key ( keys %ENV ) {
$output .= "$key => $ENV{$key}<br/>";
}
$output .= 'Hello, world!!';
$output .= $q->end_html();
return $output;
}
1;
I guess this isn;t what you wanted to hear. Maybe my config will help.
-Ants
Dileep Eduri <suppressed> wrote:
I added PerlSendHeader Off to config file and removed send_http_header call
and print call.
Now I am returning $var.
Nothing got printed...
Thanks
Michael Peters wrote:
>
>
>
> Dileep Eduri
wrote:
>> No change. still getting headers in browser.
>> this one is pretty annoying.
>
> Make that change to your config, take out the send_http_headers and the
> CGI->print().
>
> --
> Michael Peters
> Developer
> Plus Three, LP
>
>
>
-----
With Best regards,
Dileep.
***************************************************
--
View this message in context: http://www.nabble.com/mod_perl-and-CGI%3A%3AApplication..-Strange-Behaviour-tf4697759.html#a13435321
Sent from the mod_perl - General mailing list archive at Nabble.com.
Disclaimer: Technically, I'm always wrong!!
For ideas on reducing your carbon footprint visit Yahoo! For Good this month.
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.