1MooX::Struct::Util(3) User Contributed Perl DocumentationMooX::Struct::Util(3)
2
3
4
6 MooX::Struct::Util - extensions for MooX::Struct that would have been
7 overkill to include
8
10 Sugar for lazily defaulted attributes. The following two are
11 effectively the same.
12
13 use MooX::Struct WebPage1 => [
14 user_agent => [
15 lazy => 1,
16 default => sub { LWP::UserAgent->new },
17 ],
18 ];
19
20 use MooX::Struct::Util qw(lazy_default);
21 use MooX::Struct WebPage2 => [
22 user_agent => lazy_default { LWP::UserAgent->new },
23 ];
24
26 Please report any bugs to
27 <http://rt.cpan.org/Dist/Display.html?Queue=MooX-Struct>.
28
30 MooX::Struct.
31
33 Toby Inkster <tobyink@cpan.org>.
34
36 This software is copyright (c) 2012-2013, 2017-2018 by Toby Inkster.
37
38 This is free software; you can redistribute it and/or modify it under
39 the same terms as the Perl 5 programming language system itself.
40
42 THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
43 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
44 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
45
46
47
48perl v5.30.1 2020-01-30 MooX::Struct::Util(3)