hi,

        I've been developing with mod_perl for a while, but, thanks to
Richter's Embperl module and the excellent backwards compatibility
(regarding CGI.pm) I had never got anywhere near Apache::Request -- for
production, that is. 

        Now I have this very silly question, that I've boiled down to this
little snippet of code (which carries a remakable resemblance to the
example found in page 146 of the Eagle Book):
----------------------
#!/usr/bin/perl -w 
use strict;
use Apache::Constants qw(:common); 

my $r = Apache->request;
$r->content_type('text/html');
$r->send_http_header;

return OK unless $r->header_only; # THIS is the line I'm wondering about

$r->print(<<END);
<html><body><h1> Hello ! </h1>
<address> martin</address></body></html>
END
1;

------------------------        

        The issue is that I don't understand clearly what is this line supposed
to do. As it is, it'll make my script return an empty body ('document
contains no data!' said Navigator). Commented out, the proper contents
are sent. Reading the Eagle and `man Apache::Request` led me to thing
that the line is there to stop processing if all the client wants are
the headers (maybe because of a 'If-Modified-Since' parameter?). 

        Now  shouldn't it be an 'if' instead of an 'unless'?
        
        Am I too dumb today? Or is it just that it's monday?



martin

Reply via email to