[Catalyst] Still Confused

Chisel Wright chisel at herlpacker.co.uk
Fri Apr 8 23:04:05 CEST 2005


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!


I'm going to go away and re-reread Catalyst::Manual::Intro to see what
I've missed/misunderstood.

Chisel
-- 
Chisel Wright
e: chisel at herlpacker.co.uk
w: http://www.herlpacker.co.uk/

"This is not the greatest sig in the world, no, this is just a tribute."



More information about the Catalyst mailing list