in reply to How to get the Catalyst Context object
I agree that it tends to be design smell to need it but sometimes it's just the most natural way to solve a problem. I've done it three times, I think, and ended up taking one back when I realized my design error. This is the current best way to do it: Catalyst::Component::ApplicationAttribute.
# Moose extends etc with "Catalyst::Component::ApplicationAttribute"; sub somesub { my $self = shift; my $ctx = $self->_application; }
It handled handles the weakening properly and with the leading underscore emphasizes the private/dangerous nature of its usage.
|
|---|