Commit | Line | Data |
5f654d8e |
1 | package Moose::Autobox::Value; |
5272f13f |
2 | use Moose::Role 'with'; |
5f654d8e |
3 | |
e3598a18 |
4 | our $VERSION = '0.10'; |
5f654d8e |
5 | |
6 | with 'Moose::Autobox::Defined'; |
7 | |
6cf5bcf2 |
8 | sub do { |
9 | my ($self, $block) = @_; |
10 | local $_ = $self; |
11 | $block->($self); |
12 | } |
13 | |
31d40d73 |
14 | 1; |
15 | __END__ |
16 | |
17 | =pod |
18 | |
19 | =head1 NAME |
20 | |
21 | Moose::Autobox::Value - the Value role |
22 | |
23 | =head1 SYNOPOSIS |
24 | |
25 | use Moose::Autobox; |
31d40d73 |
26 | |
8937074a |
27 | # execute a sub on the value |
28 | print 10->do(sub { $_ * $_ }); # prints 100 |
31d40d73 |
29 | |
30 | =head1 DESCRIPTION |
31 | |
8937074a |
32 | This is a role to describes a defined (non-reference) Perl value. |
33 | |
260cc81f |
34 | =head1 METHODS |
35 | |
36 | =over 4 |
37 | |
38 | =item B<meta> |
39 | |
8937074a |
40 | =item B<do (\&block)> |
260cc81f |
41 | |
42 | =back |
43 | |
31d40d73 |
44 | =head1 BUGS |
45 | |
46 | All complex software has bugs lurking in it, and this module is no |
47 | exception. If you find a bug please either email me, or add the bug |
48 | to cpan-RT. |
49 | |
50 | =head1 AUTHOR |
51 | |
52 | Stevan Little E<lt>stevan@iinteractive.comE<gt> |
53 | |
54 | =head1 COPYRIGHT AND LICENSE |
55 | |
ea4e64bf |
56 | Copyright 2006-2008 by Infinity Interactive, Inc. |
31d40d73 |
57 | |
58 | L<http://www.iinteractive.com> |
59 | |
60 | This library is free software; you can redistribute it and/or modify |
61 | it under the same terms as Perl itself. |
62 | |
63 | =cut |