Ingy döt Net > Mo-0.31 > Mo::default

Download:
Mo-0.31.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.31   Source   Latest Release: Mo-0.39

Name ^

Mo::default - Adds the default feature to Mo's has

Synopsis ^

    use Mo qw'default';
    has name => ( default => sub { 'Joe' } );

Description ^

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.

syntax highlighting: