[Catalyst] Still Confused

Sebastian Riedel sri at oook.de
Sat Apr 9 00:12:07 CEST 2005


Am 08.04.2005 um 23:04 schrieb Chisel Wright:

> On Fri, Apr 08, 2005 at 10:33:33PM +0200, Sebastian Riedel wrote:
>> It works perfectly right! :)
>>
>> You defined   "sub trick : Private" which means that it's only
>> available for forwarding!
>> Try "sub trick : Local" or "sub trick : Global". ;)
>
> Hrm, maybe I'm communicating badly (again), given:
>
>   package Magic;
>
>   use strict;
>   use Catalyst qw/-Debug/;
>
>   our $VERSION = '0.01';
>
>   Magic->config(
>     name => 'Magic',
>     root => '/home/chisel/development/web/catalyst/Magic/root',
>   );
>
>   Magic->setup;
>
>   sub default : Private {
>     my ( $self, $c ) = @_;
> 	#$c->res->output('Congratulations, Magic is on Catalyst!');
> 	$c->forward('/trick');
>   }
>
>
>   package Magic::C::Trick;
>
>   use strict;
>   use base 'Catalyst::Base';
>
>   sub default : Private {
>     my ( $self, $c ) = @_;
>     $c->res->output('Congratulations, Magic::C::Trick is on 
> Catalyst!');
>   }
>
>
> I was expecting
>
>   ./script/test.pl /
>
> to produce
>
>   Congratulations, Magic::C::Trick is on Catalyst!

Aaah, now i get it... :)

forward only accepts "internal" addressing, we now make a difference 
between external and internal, default, begin, auto and end are only 
evaluated for external ones.

--
sebastian




More information about the Catalyst mailing list