[Catalyst] My::App vs MyApp ?

Christopher H. Laco claco at chrislaco.com
Sat Aug 20 14:35:52 CEST 2005


Matt S Trout wrote:
> On Thu, Aug 11, 2005 at 01:19:56PM -0700, Corey wrote:
> 
>>Hello - I'm new to catalyst; just got done browsing all the perldoc.
>>
>>I'm wondering when/why one would use, say 'catalyst.pl My::App' rather than 
>>'catalyst.pl MyApp'?
>>
>>I note the difference this creates in the directory structure - but I'm not 
>>understanding why one would desire the "extra" directory layer -  i.e. 
>>'.../lib/My/App/[C,M,V]' vs '.../lib/MyApp/[C,M,V]'
> 
> 
> A lot of places use the company name as an initial prefix then the project
> name as the second component. Makes it nice and easy to tar up the company
> specific part of the perl tree etc. etc.
> 

The first method is also useful if your building a package that has both 
core modules and a catalyst site, and you want to keep MyApp free of 
Catalyst code....

$ catalyst MyApp::Catalyst

Now, you have:

lib/MyApp/Catalyst.pm
lib/MyApp/Catalyst/M
lib/MyApp/Catalyst/V
lib/MyApp/Catalyst/C

and can add:

lib/MyApp.pm
lib/MyApp/Core.pm
..etc...


Now you use MyApp everywhere else, and load MyApp::Catalyst under 
MP/CGI/, etc.

-=CHris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3178 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20050820/26263681/smime.bin


More information about the Catalyst mailing list