gozer       2004/09/13 14:38:23

  Modified:    src/docs/2.0/api/Apache CmdParms.pod
  Log:
  Add an example usage of $parms->info
  
  Revision  Changes    Path
  1.15      +22 -0     modperl-docs/src/docs/2.0/api/Apache/CmdParms.pod
  
  Index: CmdParms.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/CmdParms.pod,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- CmdParms.pod      13 Sep 2004 21:18:56 -0000      1.14
  +++ CmdParms.pod      13 Sep 2004 21:38:23 -0000      1.15
  @@ -210,7 +210,29 @@
   
   =back
   
  +For example here is how to pass arbitrary information to a directive
  +subroutine:
   
  +  our @APACHE_MODULE_COMMANDS = (
  +    {
  +      name => 'MyDirective1',
  +      func => \&MyDirective,
  +      cmd_data => 'One',
  +    },
  +    {
  +      name => 'MyDirective2',
  +      func => \&MyDirective,
  +      cmd_data => 'Two',
  +    },
  +  );
  +  
  +  sub MyDirective {
  +    my($self, $parms, $args) = @_;
  +    my $info = $parms->info;
  +  }
  +
  +In this example C<$info> will either be 'One' or 'Two' depending on 
  +wether the directive was called as I<MyDirective1> or I<MyDirective2>
   
   
   
  
  
  

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

Reply via email to