Return-Value
view release on metacpan or search on metacpan
lib/Return/Value.pm view on Meta::CPAN
# needed to have a hashref object that can deref into a different hash.
# _ah($self,$key, [$value) sets or returns the value for the given key on the
# $self blessed-ref
sub _ah {
my ($self, $key, $value) = @_;
my $class = ref $self;
bless $self => "ain't::overloaded";
$self->{$key} = $value if @_ > 2;
my $return = $self->{$key};
bless $self => $class;
return $return;
}
sub _builder {
my %args = (type => shift);
$args{string} = shift if (@_ % 2);
%args = (%args, @_);
$args{string} = $args{type} unless defined $args{string};
lib/Return/Value.pm view on Meta::CPAN
#pod },
#pod );
#pod
#pod Creates a new C<Return::Value> object. Named parameters can be used to set the
#pod object's attributes.
#pod
#pod =cut
sub new {
my $class = shift;
bless { type => 'failure', string => q{}, prop => {}, @_ } => $class;
}
#pod =pod
#pod
#pod =item bool
#pod
#pod print "it worked" if $result->bool;
#pod
#pod Returns the result in boolean context: true for success, false for failure.
#pod
( run in 0.263 second using v1.01-cache-2.11-cpan-4d50c553e7e )