1Config::MVP::Section(3)User Contributed Perl DocumentatioCnonfig::MVP::Section(3)
2
3
4

NAME

6       Config::MVP::Section - one section of an MVP configuration sequence
7

VERSION

9       version 2.200013
10

DESCRIPTION

12       For the most part, you can just consult Config::MVP to understand what
13       this class is and how it's used.
14

PERL VERSION

16       This module should work on any version of perl still receiving updates
17       from the Perl 5 Porters.  This means it should work on any version of
18       perl released in the last two to three years.  (That is, if the most
19       recently released version is v5.40, then this module should work on
20       both v5.40 and v5.38.)
21
22       Although it may work on older versions of perl, no guarantee is made
23       that the minimum required version will not be increased.  The version
24       may be increased for any reason, and there is no promise that patches
25       will be accepted to lower the minimum required perl.
26

ATTRIBUTES

28   name
29       This is the section's name.  It's a string, and it must be provided.
30
31   package
32       This is the (Perl) package with which the section is associated.  It is
33       optional.  When the section is instantiated, it will ensure that this
34       package is loaded.
35
36   multivalue_args
37       This attribute is an arrayref of value names that should be considered
38       multivalue properties in the section.  When added to the section, they
39       will always be wrapped in an arrayref, and they may be added to the
40       section more than once.
41
42       If this attribute is not given during construction, it will default to
43       the result of calling section's package's "mvp_multivalue_args" method.
44       If the section has no associated package or if the package doesn't
45       provide that method, it default to an empty arrayref.
46
47   aliases
48       This attribute is a hashref of name remappings.  For example, if it
49       contains this hashref:
50
51         {
52           file => 'files',
53           path => 'files',
54         }
55
56       Then attempting to set either the "file" or "path" setting for the
57       section would actually set the "files" setting.
58
59       If this attribute is not given during construction, it will default to
60       the result of calling section's package's "mvp_aliases" method.  If the
61       section has no associated package or if the package doesn't provide
62       that method, it default to an empty hashref.
63
64   payload
65       This is the storage into which properties are set.  It is a hashref of
66       names and values.  You should probably not alter the contents of the
67       payload, and should read its contents only.
68
69   is_finalized
70       This attribute is true if the section has been marked finalized, which
71       will prevent any new values from being added to it.  It can be set with
72       the "finalize" method.
73
74   sequence
75       This attributes points to the sequence into which the section has been
76       assembled.  It may be unset if the section has been created but not yet
77       placed in a sequence.
78

METHODS

80   add_value
81         $section->add_value( $name => $value );
82
83       This method sets the value for the named property to the given value.
84       If the property is a multivalue property, the new value will be pushed
85       onto the end of an arrayref that will store all values for that
86       property.
87
88       Attempting to add a value for a non-multivalue property whose value was
89       already added will result in an exception.
90
91   load_package
92         $section->load_package($package, $section_name);
93
94       This method is used to ensure that the given $package is loaded, and is
95       called whenever a section with a package is created.  By default, it
96       delegates to Class::Load.  If the package can't be found, it calls the
97       missing_package method.  Errors in compilation are not suppressed.
98
99   missing_package
100         $section->missing_package($package, $section_name);
101
102       This method is called when "load_package" encounters a package that is
103       not installed.  By default, it throws an exception.
104

AUTHOR

106       Ricardo Signes <cpan@semiotic.systems>
107
109       This software is copyright (c) 2022 by Ricardo Signes.
110
111       This is free software; you can redistribute it and/or modify it under
112       the same terms as the Perl 5 programming language system itself.
113
114
115
116perl v5.38.0                      2023-07-20           Config::MVP::Section(3)
Impressum