Mo::default - Adds the default feature to Mo's has
use Mo qw'default'; has name => ( default => sub { 'Joe' } );
Adds the default parameter to has, which expects a code reference, returning a value to be used to set the attribute to if it hasn't been set yet.
Currently this is always called lazily.
To install Mo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mo
CPAN shell
perl -MCPAN -e shell install Mo
For more information on module installation, please visit the detailed CPAN module installation guide.