I've been working on a small utility role to replace some old code at work. It has also served as an interesting case in learning Moose. I'll spare everyone the gory details (unless you want them), but basically the purpose was to provide a configurable in-production (while code is running) stack trace of sorts. So every method was to print to STDERR at the beginning and end so we could analyze process in the logs.
Reading Moose::Manual it seemed like this should be easily achievable in any Moose class using a role that set appropriate before & after calls. It provides consistent application, the output is always the same, and it can switched on and off per instance if we want. The file attached is my first working proof-of-concept. Is this potentially something of sufficient interest to share through Moose/CPAN? KaeseEs indicated on IRC that there had been some discussion of where to put general purpose Roles and how to name them. Is there any general consensus on this? (the one thread I read seemed to indicate there wasn't) For the moment I've named the role MooseX::Role::TraceMethodDispatch, but I am open to suggestions. Thanks, Sean (spq)
TraceMethodDispatch.pm
Description: Perl program
