X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FComponent%2FContextClosure.pm;h=b25cc46a66844c13debdbf8c74b081ed45db2f0e;hp=475b9622bb6799fe3e761a60c3504861629b0360;hb=3ac082e46385d8f5a94838e8790538dc1f694565;hpb=c9f762d744cb30613f7804bb03733c90c1a45c0e diff --git a/lib/Catalyst/Component/ContextClosure.pm b/lib/Catalyst/Component/ContextClosure.pm index 475b962..b25cc46 100644 --- a/lib/Catalyst/Component/ContextClosure.pm +++ b/lib/Catalyst/Component/ContextClosure.pm @@ -6,7 +6,6 @@ use namespace::autoclean; sub make_context_closure { my ($self, $closure, $ctx) = @_; - my $weak_ctx = $ctx; weaken $ctx; return sub { $closure->($ctx, @_) }; } @@ -23,7 +22,7 @@ Catalyst::Component::ContextClosure - Moose Role for components which need to cl package MyApp::Controller::Foo; use Moose; - use namespace::autoclean; + use namespace::clean -except => 'meta'; BEGIN { extends 'Catalyst::Controller'; with 'Catalyst::Component::ContextClosure'; @@ -34,7 +33,7 @@ Catalyst::Component::ContextClosure - Moose Role for components which need to cl $ctx->stash(a_closure => $self->make_context_closure(sub { my ($ctx) = @_; $ctx->response->body('body set from closure'); - }, $ctx); + }, $ctx)); } =head1 DESCRIPTION @@ -64,9 +63,13 @@ L L +=begin stopwords + =head1 AUTHOR -Florian Ragwitz Erafl@debian.orgE +Florian Ragwitz + +=end stopwords =head1 COPYRIGHT