Fellow monks, I'm starting with Catalyst and I'm confused at the moment about how catalyst handles my request.

Basically I ran:

catalyst.pl Greet; cd Greet scripts/greet_create.pl view TT TT scripts/greet_create.pl controller Greeting echo "[% greeting %]" > root/greeting.tt

And edited 'lib/Greet/C/Greeting.pm' so it looks like this:

sub default : Private { my ( $self, $c ) = @_; $c->forward('say'); } sub say : Local { my ( $self, $c ) = @_; $c->stash->{greeting} = join q{, }, @{ $c->req->args() }; $c->stash->{template} = q{greeting.tt}; $c->forward('Greet::V::TT'); }

Now running a couple of scenarios, I get:

1. scripts/greet_test.pl / -> Congratulations, Greet is on Catalyst! 2. scripts/greet_test.pl /greeting/say/hello/world -> hello, world 3. scripts/greet_test.pl /greeting/hello/world -> greeting, hello, world 4. scripts/greet_test.pl /hi/there/greeting/say/hello/world -> hi, there, greeting, say, hello, world

Now, scenario 1 is as expected. I didn't change the main file and it presents the default blurb.

Scenario 2 is also as expected, I run the controller with the say request and it answers me back with the arguments.

But what about scene 3? Why didn't that strip the namespace from the arguments? And I'm really confused about scene 4. I would have expected that to print the same as 1.

Can someone explain this behaviour to me?

--
Lyon


In reply to Catalyst request handling by redlemon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.