Re: [NQ] Newbie Question about mod_perl

2001-03-20 Thread Pierre Phaneuf

> "Differentiated Software Solutions Pvt. Ltd.," wrote:

> I have written two mod_perl programs whose output is same (through
> browser).
> I want to know what are the difference between them!  If there is any
> difference then what are the pros and cons in using both of them?

The second program is taking advantage of the PerlSendHeader feature.
This is mostly a compatibility feature, I would tend to think that it
might be slightly slower (because mod_perl has to watch for the empty
line).

The first program should be a very small amount faster, as far as I
know, but the second has a partial advantage of portability to
non-mod_perl regular CGI environment. I say "partial", because you test
for $ENV{MOD_PERL}, which you don't need to do.

-- 
"The number of Unix installations has grown to 10, with more expected."
 -- The Unix Programmer's Manual, 2nd Edition, June 1972



[NQ] Newbie Question about mod_perl

2001-03-19 Thread Differentiated Software Solutions Pvt. Ltd.,




Hi,
 
Now I am doing 
mod_perl programing And I have gone through the related documents 
also.
I have written two 
mod_perl programs whose output is same (through browser).
I want to know what 
are the difference between them!  If there is any difference then what are 
the pros and cons in using both of them?
 
one.cgi
 
if(exists 
$ENV{MOD_PERL}) {   my $r = Apache->request;   
$r->content_type("text/html");   
$r->send_http_header;   $r->print("Hi 
There!");}
 
two.cgi
 
if(exists 
$ENV{MOD_PERL}) {    print "Content-Type: 
text/html\n\n";    print "Hi 
There!";}
 
Thanks,
Muthu S 
Ganesh
 
 
 
P.S.
 
[NQ] <- Newbie 
Question
 
 
 
 
 
Differentiated Software Solutions Pvt. Ltd.,90, 3rd Cross,2nd Main, 
Ganga Nagar,Bangalore - 560 032Phone : 91 80 3631445Visit us at 
www.diffsoft.com