Raisin::Attributes - Simple attributes accessors for Raisin.
use Raisin::Attributes; has hello => sub { 'hello' }; say $self->hello; # -> hello has 'new'; say $self->new; # -> undef has key => 'value'; say $self->key; # -> value
Simple implementation of attribute accessors.
This code:
has key => 'value';
Will produce:
sub key { my ($self, $value) = @_; $self->{key} = $value if defined $value; return $self->{key} // 'value'; }
To install Raisin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Raisin
CPAN shell
perl -MCPAN -e shell install Raisin
For more information on module installation, please visit the detailed CPAN module installation guide.