<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Config::Utils - Common config utilities.

SYNOPSIS
     use Config::Utils qw(conflict hash hash_array);
     conflict($self, {'key' =&gt; 1}, 'key');
     hash($self, ['one', 'two'], $val);
     hash_array($self, ['one', 'two'], $val);

SUBOUTINES
    conflict($self, $config_hr, $key)
             Check conflits.
             Affected variables from $self:
             - set_conflicts - Flag, then control conflicts.
             - stack - Reference to array with actual '$key' key position.
             Returns undef or fatal error.

    hash($self, $key_ar, $val)
             Create record to hash.
             Affected variables from $self:
             - config - Actual configuration in hash reference.
             - set_conflicts - Flag, then control conflicts.
             - stack - Reference to array with actual '$key' key position.
             Returns undef or fatal error.

    hash_array($self, $key_ar, $val)
             Create record to hash.
             If exists more value record for one key, then create array of values.
             Affected variables from $self:
             - config - Actual configuration in hash reference.
             - set_conflicts - Flag, then control conflicts.
             - stack - Reference to array with actual '$key' key position.
             Returns undef or fatal error.

ERRORS
     conflict():
             Conflict in '%s'.

     hash():
             Conflict in '%s'.

     hash_array():
             Conflict in '%s'.

EXAMPLE1
     # Pragmas.
     use strict;
     use warnings;

     # Modules.
     use Config::Utils qw(conflict);

     # Object.
     my $self = {
             'set_conflicts' =&gt; 1,
             'stack' =&gt; [],
     };

     # Conflict.
     conflict($self, {'key' =&gt; 'value'}, 'key');

     # Output:
     # ERROR: Conflict in 'key'.

EXAMPLE2
     # Pragmas.
     use strict;
     use warnings;

     # Modules.
     use Config::Utils qw(hash);
     use Dumpvalue;

     # Object.
     my $self = {
             'config' =&gt; {},
             'set_conflicts' =&gt; 1,
             'stack' =&gt; [],
     };

     # Add records.
     hash($self, ['foo', 'baz1'], 'bar');
     hash($self, ['foo', 'baz2'], 'bar');

     # Dump.
     my $dump = Dumpvalue-&gt;new;
     $dump-&gt;dumpValues($self);

     # Output:
     # 0  HASH(0x955f3c8)
     #    'config' =&gt; HASH(0x955f418)
     #       'foo' =&gt; HASH(0x955f308)
     #          'baz1' =&gt; 'bar'
     #          'baz2' =&gt; 'bar'
     #    'set_conflicts' =&gt; 1
     #    'stack' =&gt; ARRAY(0x955cc38)
     #         empty array

EXAMPLE3
     # Pragmas.
     use strict;
     use warnings;

     # Modules.
     use Config::Utils qw(hash_array);
     use Dumpvalue;

     # Object.
     my $self = {
             'config' =&gt; {},
             'set_conflicts' =&gt; 1,
             'stack' =&gt; [],
     };

     # Add records.
     hash_array($self, ['foo', 'baz'], 'bar');
     hash_array($self, ['foo', 'baz'], 'bar');

     # Dump.
     my $dump = Dumpvalue-&gt;new;
     $dump-&gt;dumpValues($self);

     # Output:
     # 0  HASH(0x8edf890)
     #    'config' =&gt; HASH(0x8edf850)
     #       'foo' =&gt; HASH(0x8edf840)
     #          'baz' =&gt; ARRAY(0x8edf6d0)
     #             0  'bar'
     #             1  'bar'
     #    'set_conflicts' =&gt; 1
     #    'stack' =&gt; ARRAY(0x8edf6e0)
     #         empty array

EXAMPLE4
     # Pragmas.
     use strict;
     use warnings;

     # Modules.
     use Config::Utils qw(hash_array);
     use Dumpvalue;

     # Object.
     my $self = {
             'callback' =&gt; sub {
                     my ($key_ar, $value) = @_;
                     return uc($value);
             },
             'config' =&gt; {},
             'set_conflicts' =&gt; 1,
             'stack' =&gt; [],
     };

     # Add records.
     hash_array($self, ['foo', 'baz'], 'bar');
     hash_array($self, ['foo', 'baz'], 'bar');

     # Dump.
     my $dump = Dumpvalue-&gt;new;
     $dump-&gt;dumpValues($self);

     # Output:
     # 0  HASH(0x8edf890)
     #    'callback' =&gt; CODE(0x8405c40)
     #       -&gt; &amp;CODE(0x8405c40) in ???
     #    'config' =&gt; HASH(0x8edf850)
     #       'foo' =&gt; HASH(0x8edf840)
     #          'baz' =&gt; ARRAY(0x8edf6d0)
     #             0  'BAR'
     #             1  'BAR'
     #    'set_conflicts' =&gt; 1
     #    'stack' =&gt; ARRAY(0x8edf6e0)
     #         empty array

DEPENDENCIES
    Error::Pure, Exporter, Readonly.

SEE ALSO
    Config::Dot.

AUTHOR
    Michal Е&nbsp;paДЌek &lt;mailto:skim@cpan.org&gt;

    &lt;http://skim.cz&gt;

LICENSE AND COPYRIGHT
    BSD license.

VERSION
    0.03

</pre></body></html>