There are not many examples of composition on CPAN because CPAN is mostly smaller pieces. DBIx::Class uses inheritance, modified by Class::C3. Template Toolkit has an excellent plugin API, but that's kind of separate from composition.
However, if you look at the TT code, it does use composition internally. For example, a Template::Provider is a service for finding templates which the main Template object points to. You can implement the API and create a Template object that points to yours instead of the default one. It's a very good system for replacing bits and pieces.
Another plugin system that worked out really well is Crypt::CBC, but again it's not so much composition as a specific plugin API. | [reply] |