logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

MooX::Struct::Util - extensions for MooX::Struct that would have been overkill to include

Author

       Toby Inkster <tobyink@cpan.org>.

Bugs

       Please report any bugs to <http://rt.cpan.org/Dist/Display.html?Queue=MooX-Struct>.

Disclaimer Of Warranties

       THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
       LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

perl v5.36.0                                       2022-12-12                            MooX::Struct::Util(3pm)

Lazy Defaults

       Sugar for lazily defaulted attributes. The following two are effectively the same.

        use MooX::Struct WebPage1 => [
           user_agent => [
              lazy     => 1,
              default  => sub { LWP::UserAgent->new },
           ],
        ];

        use MooX::Struct::Util qw(lazy_default);
        use MooX::Struct WebPage2 => [
           user_agent => lazy_default { LWP::UserAgent->new },
        ];

Name

       MooX::Struct::Util - extensions for MooX::Struct that would have been overkill to include

See Also

       MooX::Struct.

See Also