[Catalyst] handler sub required

Alain Wan alain.wan at gmail.com
Sat Jul 23 01:52:07 GMT 2011


I am having an issue with Catalyst::Controller::REST, which I am trying to
use with mod_perl2 on apache2. For some reason in my handler, I need to
define a handler sub, in which case "hello world" does get returned:

sub handler{
  my $r =3D shift;
  print "hello world\n";

  return Apache2::Const::OK;

Otherwise, modperl2 complains that the handler method is missing.

 My settings in  apache2 conf are as follows:

  PerlModule app
  <Location /loc>
      SetHandler perl-script
      PerlResponseHandler app

The code is as follows:


package app;

use Apache2::RequestRec ();
use Apache2::RequestIO ();

use Apache2::Const -compile =3D> qw(OK);

use Moose;
use namespace::autoclean;

BEGIN { extends 'Catalyst::Controller::REST' }

    sub hello :Local :ActionClass('REST') {
      print "handler entered\n";

    sub hello_GET {
       my ( $self, $c ) =3D @_;

            entity =3D> {
                some =3D> 'data',
                foo  =3D> 'is real bar-y',


Thanks in advance for the help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110722/b7e59=

More information about the Catalyst mailing list