[Catalyst] handler sub required

Alain Wan alain.wan at gmail.com
Sat Jul 23 17:03:05 GMT 2011


Thanks for the reply Tomas. I will use catalyst.pl to get started and see
how it goes.

Thanks!

Alain.


On Sat, Jul 23, 2011 at 2:38 AM, Tomas Doran <bobtfish at bobtfish.net> wrote:

>
> On 23 Jul 2011, at 02:52, Alain Wan wrote:
>
>  The code is as follows:
>>
>> app.pm:
>>
>> package app;
>>
>> use Apache2::RequestRec ();
>> use Apache2::RequestIO ();
>>
>> use Apache2::Const -compile =3D> qw(OK);
>>
>>
> Why are you importing any of this stuff?
>
> You should let Catalyst take care of loading the engine etc itself.
>
>
>  use Moose;
>> use namespace::autoclean;
>>
>> BEGIN { extends 'Catalyst::Controller::REST' }
>>
>>    sub hello :Local :ActionClass('REST') {
>>      print "handler entered\n";
>>    }
>>
>>
> Don't put actions in the root application class! It should work currently,
> but it's not been generated by the helper for > 3 years, and it'll stop
> working in an upcoming major release!
>
> Please start with the template generated by catalyst.pl, which will give
> you an app::Controller::Root.
>
> Although I'd suggest 'app' isn't the best namespace for your application =
:)
>
> Cheers
> t0m
>
>
>
> ______________________________**_________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-**bin/mailman/listinfo/catalyst<ht=
tp://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst>
> Searchable archive: http://www.mail-archive.com/**
> catalyst at lists.scsys.co.uk/<http://www.mail-archive.com/catalyst@lists.sc=
sys.co.uk/>
> Dev site: http://dev.catalyst.perl.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110723/c7210=
834/attachment.htm


More information about the Catalyst mailing list