1Data::Perl::Role::Code(U3s)er Contributed Perl DocumentatDiaotna::Perl::Role::Code(3)
2
3
4
6 Data::Perl::Role::Code - Wrapping class for Perl coderefs.
7
9 version 0.002009
10
12 use Data::Perl qw/code/;
13
14 my $code = code(sub { 'Foo'} );
15
16 $code->execute(); # returns 'Foo';
17
19 This class provides a wrapper and methods for interacting with Perl
20 coderefs.
21
23 new($coderef)
24 Constructs a new Data::Perl::Code object, initialized to $coderef
25 as passed in, and returns it.
26
27 execute(@args)
28 Calls the coderef with the given args.
29
30 execute_method(@args)
31 Calls the coderef with the the instance as invocant and given args.
32 This is currently disabled and triggers a die due to implementation
33 details yet to be resolved.
34
36 · Data::Perl
37
38 · MooX::HandlesVia
39
41 Matthew Phillips <mattp@cpan.org>
42
44 This software is copyright (c) 2014 by Matthew Phillips
45 <mattp@cpan.org>.
46
47 This is free software; you can redistribute it and/or modify it under
48 the same terms as the Perl 5 programming language system itself.
49
50
51
52perl v5.28.0 2014-06-27 Data::Perl::Role::Code(3)