[Catalyst] Catalyst 5 Preview, Part 2

Sebastian Riedel sri at oook.de
Tue Apr 5 22:16:58 CEST 2005


Am 05.04.2005 um 21:20 schrieb Uwe Voelker:

> Sorry, it's me again. :-)

:)

> I have a few questions:
>
>>     package MyApp;
>>     sub begin : Private {}
>>     sub auto : Private { return 1 }
>>     sub end : Private {}
>>     package MyApp::C::Foo;
>>     sub auto : Private { return 1 }
>>     sub bar : Local {}
>>     sub end : Private {}
>> Now if you request http://localhost:3000/foo/bar/ Cat5 would process:
>>     MyApp->begin;
>>     MyApp->auto;
>>     MyApp::C::Foo->auto;
>>     MyApp::C::Foo->bar;
>>     MyApp::C::Foo->end;
>
> 1. Why is MyApp->end not processed?

Because MyApp::C::Foo->end overloads it

>
> 2. What would happened if a sub MyApp::C::Foo->begin had existed?

It would overload MyApp->begin

>
> 3. What happens if in MyApp a sub with :Path('/foo/bar') exists? Which 
> one will be called? When both are called - in which order?

There can be only one, so the one defined last would get executed.


--
sebastian




More information about the Catalyst mailing list