| Moose-Autobox documentation | Contained in the Moose-Autobox distribution. |
Moose::Autobox::Value - the Value role
use Moose::Autobox;
# execute a sub on the value
print 10->do(sub { $_ * $_ }); # prints 100
This is a role to describes a defined (non-reference) Perl value.
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.
Stevan Little <stevan@iinteractive.com>
Copyright 2006-2008 by Infinity Interactive, Inc.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Moose-Autobox documentation | Contained in the Moose-Autobox distribution. |
package Moose::Autobox::Value; use Moose::Role 'with'; our $VERSION = '0.11'; with 'Moose::Autobox::Defined'; sub do { my ($self, $block) = @_; local $_ = $self; $block->($self); } 1; __END__