Moose::Autobox::Value - the Value role


Moose-Autobox documentation Contained in the Moose-Autobox distribution.

Index


Code Index:

NAME

Top

Moose::Autobox::Value - the Value role

SYNOPOSIS

Top

  use Moose::Autobox;

  # execute a sub on the value
  print 10->do(sub { $_ * $_ }); # prints 100

DESCRIPTION

Top

This is a role to describes a defined (non-reference) Perl value.

METHODS

Top

meta
do (\&block)

BUGS

Top

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.

AUTHOR

Top

Stevan Little <stevan@iinteractive.com>

COPYRIGHT AND LICENSE

Top


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__