stas        02/01/22 08:37:40

  Modified:    src/docs/2.0/user/compat compat.pod
  Log:
  - document the compatibility of method handlers (have to use sub
  attributes)
  
  Revision  Changes    Path
  1.7       +35 -0     modperl-docs/src/docs/2.0/user/compat/compat.pod
  
  Index: compat.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/compat/compat.pod,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- compat.pod        6 Jan 2002 17:57:24 -0000       1.6
  +++ compat.pod        22 Jan 2002 16:37:40 -0000      1.7
  @@ -90,6 +90,41 @@
   =head2 Apache::File
   
   
  +=head1 Miscellaneous
  +
  +=head2 Method Handlers
  +
  +In mod_perl 1.x the method handlers could be specified by using the
  +C<($$)> prototype:
  +
  +  package Bird;
  +  @ISA = qw(Eagle);
  +  
  +  sub handler ($$) {
  +      my($class, $r) = @_;
  +      ...;
  +  }
  +
  +Starting from Perl version 5.6 the subroutine attributes are used in
  +place of subroutine prototypes:
  +
  +  package Bird;
  +  @ISA = qw(Eagle);
  +  
  +  sub handler : method {
  +      my($class, $r) = @_;
  +      ...;
  +  }
  +
  +see the L<attributes> manpage for additional information on subroutine
  +attributes.
  +
  +mod_perl 2.0 doesn't support the C<($$)> prototypes, mainly because
  +several callbacks in 2.0 have more arguments than C<$r>, so the
  +C<($$)> prototype doesn't make sense anymore. Therefore if you want
  +your code to work with both mod_perl generations, you should use the
  +subroutine attributes.
  +
   
   =head1 Apache::Registry and Apache::PerlRun and Other mod_cgi Emulators
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to