Intro to Apache - ApacheCon 2005
mod_perl handlers
  • A mod_perl handler is just a Perl module with a method that handles HTTP requests

    
         package Apache::HandlerTest;
    
      
    
         sub handler {
              my $r = shift; # Apache session object
              $r->content_type('text/html');
              $r->send_http_header;
              $r->print( "Hello, world." );
         }
         1;
    
      

  • Load as before

    
       <Location /handlertest>
         SetHandler perl-script
         PerlHandler Apache:HandlerTest:
       </Location>  
    
      

Index
Back to mod_perl handlers
Forward to mod_perl handlers

ApacheCon 2005 : Intro to Apache - Slide #159 of 164