GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MO::BUILD (3)

.ds Aq ’

Name

Mo::build - Adds the build feature to Mo

CONTENTS

Synopsis



    use Mo qwbuild;
    has name => ( is => rw );

    sub BUILD {
        my $self = shift;
        ...
    }



Description

Adds the BUILD feature to Mo when imported.

If a sub called BUILD exists on the package, it will be executed on $self during instantiation.

Any non-lazy default and builder attributes, as well as any value passed to new will already be set when BUILD is called.



    package ABCD;
    use Mo qwbuild builder default;
    use feature say;

    has a => (default => 1234, lazy => 0);
    has b => (builder => _b, lazy => 0);
    has c => (is => rw);
    has d => (is => rw);

    sub _b { blue }

    sub BUILD {
        my ($self) = @_;
        say $self->{a};
        say $self->{b};
        say $self->{c};
        say undef unless defined $self->{d};
    }

    ABCD->new(c => days) # => 1234
                           #    blue
                           #    days
                           #    undef



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MO::BUILD (3) 2014-09-04

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.