The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Name

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

Synopsis

    use Mo qw'builder';
    has name => ( builder => 'name_lookup' );

    sub name_lookup {
        my ($self) = @_;
        ...
    }

Description

Adds the builder parameter to has, which expects a method name, which is executed on $self to set the attribute if it hasn't been set yet.

Currently this is always called lazily.