|Perl: the Markov chain saw|
Re: Moose examplesby stvn (Monsignor)
|on Sep 03, 2009 at 13:15 UTC||Need Help??|
Here are a couple suggestions from my CPAN directory, all of which are being used in production at my $work. Unfortunately the docs are kind of slim in many of them (not enough time in the day for me), but I think you are more interested in reading the code anyway. Be sure to also check out the test suites though, they are always helpful in the absence of docs.
Forest::Tree is a basic n-ary tree object, which is a pretty standard data structure so should be easy to understand. For examples of roles that are meant to be combined with Forest::Tree, take a look at Forest::Tree::Roles::HasNodeFormatter, Forest::Tree::Roles::MetaData and Forest::Tree::Roles::JSONable. The distro also comes with a number of utility modules, each of which has an interface role associated, such as Forest::Tree::Reader is the interface role for Forest::Tree::Reader::SimpleTextFile.
This module is actually very simple, it is meant to fill the need for a non-ASCII-output text flow module. It makes light use of Moose here, but I thought it might be helpful.
This is Yet Another path routing/dispatching module. Each of the classes are pretty small and so easy to see what is going on.
This is another pretty simple (but useful) module that makes interesting use of Moose type constraints. It also has some usage of MooseX::Params::Validate which is one of the nicer Moose extensions.
This a simple wrapper around the lighttpd web server, it will require that you have that to actually run this code, but the code itself should be pretty readable anyway. It makes use of a number of Moose features, such as; coercion, builders, predicates and clearers as well as augment/inner (which is the inverse of override/super). Again, the test suite is a good place to look.
This module was an attempt to fill the gap with FastCGI deployment. Catalyst had some nice tools, but beyond that there was nothing so I took the good bits from Catalyst and added a few more myself. Of particular interest would probably be the FCGI::Engine::Types module as it has some nice and reasonably simple examples of type constraint usage. Also note that the FCGI::Engine module itself consumes the MooseX::Getopt role which allows it to be easily called from the command line.
This is a wrapper around Excel::Template and I was particularly fond of some of the bits of Excel::Template::Plus::TT, specifically where we actually wrapped the Excel::Template object and delegated to methods.
Outside of my own CPAN directory, I would also recommend looking at any of the following, many of which I have used myself and some of which I plan to use at some point.