From: Matt S Trout Date: Wed, 9 Nov 2005 20:16:37 +0000 (+0000) Subject: - Made $c->namespace lvalue in the name of encapsulation under local X-Git-Tag: 5.7099_04~986 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=261c571ec577304a8a41218a4576675c8099069a;hp=0cf56dbcd3a060c815aa5e66a67709bb51efd80d - Made $c->namespace lvalue in the name of encapsulation under local --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 7e0cc98..781736c 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -16,11 +16,14 @@ use Path::Class; use Time::HiRes qw/gettimeofday tv_interval/; use URI; use Scalar::Util qw/weaken/; +use attributes; __PACKAGE__->mk_accessors( qw/counter depth request response state action namespace/ ); +attributes->import(__PACKAGE__, \&namespace, 'lvalue'); + # Laziness++ *comp = \&component; *req = \&request; diff --git a/lib/Catalyst/Action.pm b/lib/Catalyst/Action.pm index e8b5230..b2a0947 100644 --- a/lib/Catalyst/Action.pm +++ b/lib/Catalyst/Action.pm @@ -41,7 +41,7 @@ See L. sub execute { # Execute ourselves against a context my ( $self, $c ) = @_; - local $c->{namespace} = $self->namespace; + local $c->namespace = $self->namespace; return $c->execute( $self->class, $self ); }