projects
/
catagits/Catalyst-Runtime.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
0aaf8bf3a7ae278b82ed9f4c22ca6092fa7c64c7
[catagits/Catalyst-Runtime.git]
/
lib
/
Catalyst
/
Component
/
ContextClosure.pm
1
package Catalyst::Component::ContextClosure;
2
3
use Moose::Role;
4
use Scalar::Util 'weaken';
5
use namespace::autoclean;
6
7
sub make_context_closure {
8
my ($self, $closure, $ctx) = @_;
9
my $weak_ctx = $ctx;
10
weaken $ctx;
11
return sub { $closure->($ctx, @_) };
12
}
13
14
1;