You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs-cvs@perl.apache.org by mo...@apache.org on 2002/04/25 23:45:19 UTC

cvs commit: modperl-docs/src/start/tips handler.pod

moseley     02/04/25 14:45:19

  Modified:    src/start/tips handler.pod
  Log:
  Add 1.x as the mod_perl version and fix a typo on Apache::Constants::OK
  constant.
  
  Revision  Changes    Path
  1.2       +2 -2      modperl-docs/src/start/tips/handler.pod
  
  Index: handler.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/start/tips/handler.pod,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- handler.pod	25 Apr 2002 07:01:02 -0000	1.1
  +++ handler.pod	25 Apr 2002 21:45:19 -0000	1.2
  @@ -2,7 +2,7 @@
   
   Content Handler Example
   
  -=head1 Creating a content handler with mod_perl
  +=head1 Creating a content handler with mod_perl 1.x
   
   Handlers are simply perl subroutines called by the server at various stages of the HTTP request cycle.
   A content handler is a subroutine that is called by the response phase.  Handlers, are 
  @@ -24,7 +24,7 @@
                   Thanks for visiting $server_name.
                   The local time is $now
           EOT
  -            return $Apache::Constants::OK;
  +            return Apache::Constants::OK;
           }
           1; # modules must return true
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org


Re: cvs commit: modperl-docs/src/start/tips handler.pod

Posted by Bill Moseley <mo...@hank.org>.
At 11:11 PM 04/26/02 +0800, Stas Bekman wrote:
>Not really saving here, you should load the module before you use the 
>constants from it. I think it's more confusing when you use constants 
>that may be not loaded elsewhere.

Using use Apache::Constants qw(OK) is just fine.

>Aren't you on the cvs list, Bill?

Nope.  That would just make for more work -- I don't want to start arguing
about the commits, too. ;)


-- 
Bill Moseley
mailto:moseley@hank.org

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org


Re: cvs commit: modperl-docs/src/start/tips handler.pod

Posted by Stas Bekman <st...@stason.org>.
Bill Moseley wrote:
> At 07:12 AM 4/26/2002 +0200, Per Einar Ellefsen wrote:
> 
>>At 23:45 25.04.2002, moseley@apache.org wrote:
>>
>>
>>>  -            return $Apache::Constants::OK;
>>>  +            return Apache::Constants::OK;
>>>           }
>>
>>Shouldn't you just be using OK here (and import it from Apache::Constants)? 
>>More intuitive for newbies.
> 
> 
> Depends on the newbie.  I remember wondering where return OK; came from
> when first starting out.  For some people it might be easier to see an
> explicit call to that package "constant".  The real reason I did that was
> it took one less line of code. 

Not really saving here, you should load the module before you use the 
constants from it. I think it's more confusing when you use constants 
that may be not loaded elsewhere.

> I don't see it as a big issue, but if you
> do I can change.  It's probably more common to just return OK;  Just a
> little more pollution. ;)

Aren't you on the cvs list, Bill? I have changed a whole bunch of things 
while you were sleeping :)
Mainly adhering to the docs style

-- 


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org


Re: cvs commit: modperl-docs/src/start/tips handler.pod

Posted by Bill Moseley <mo...@hank.org>.
At 07:12 AM 4/26/2002 +0200, Per Einar Ellefsen wrote:
>At 23:45 25.04.2002, moseley@apache.org wrote:
>
>>   -            return $Apache::Constants::OK;
>>   +            return Apache::Constants::OK;
>>            }
>
>Shouldn't you just be using OK here (and import it from Apache::Constants)? 
>More intuitive for newbies.

Depends on the newbie.  I remember wondering where return OK; came from
when first starting out.  For some people it might be easier to see an
explicit call to that package "constant".  The real reason I did that was
it took one less line of code.  I don't see it as a big issue, but if you
do I can change.  It's probably more common to just return OK;  Just a
little more pollution. ;)


Bill Moseley
mailto:moseley@hank.org

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org


Re: cvs commit: modperl-docs/src/start/tips handler.pod

Posted by Stas Bekman <st...@stason.org>.
Per Einar Ellefsen wrote:
> At 23:45 25.04.2002, moseley@apache.org wrote:
> 
>>   -            return $Apache::Constants::OK;
>>   +            return Apache::Constants::OK;
>>            }
> 
> 
> Shouldn't you just be using OK here (and import it from 
> Apache::Constants)? More intuitive for newbies.

sure, done


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org


Re: cvs commit: modperl-docs/src/start/tips handler.pod

Posted by Per Einar Ellefsen <pe...@skynet.be>.
At 23:45 25.04.2002, moseley@apache.org wrote:

>   -            return $Apache::Constants::OK;
>   +            return Apache::Constants::OK;
>            }

Shouldn't you just be using OK here (and import it from Apache::Constants)? 
More intuitive for newbies.


-- 
Per Einar Ellefsen
per.einar@skynet.be



---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org