<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
     Class::Params - Parameter utils for constructor.

SYNOPSIS
     use Class::Params qw(params);
     params($self, $def_hr, $params_ar);

DEFINITION FORMAT
     There is hash with parameters.
     internal_name =&gt; [real_name, possible_types, requirement]

     Example:
     'par1' =&gt; ['_par1', 'SCALAR', 1],
     'par2' =&gt; ['_par2', ['SCALAR', 'HASH'], 0],
     'par3' =&gt; ['_par3', ['SCALAR', 'Class'], 0],

SUBROUTINES
    "params($self, $def_hr, $params_ar)"
             Check for structure over definition and save input data to $self.
             Parameters:
             $self - Structure, for data save.
             $def_hr - Definition hash ref.
             $params_ar - Reference to array of key-value pairs.
             Returns undef.

ERRORS
     params():
             Bad parameter '%s' type.
             Parameter '%s' is required.
             Unknown parameter '%s'.

EXAMPLE1
     # Pragmas.
     use strict;
     use warnings;

     # Modules.
     use Class::Params qw(params);

     # Definition.
     my $self = {};
     my $def_hr = {
             'par' =&gt; ['par', 'SCALAR', 1],
     };

     # Check.
     # output_structure, definition, array of pairs (key, value).
     params($self, $def_hr, ['bad_par', 1]);

     # Output:
     # Unknown parameter 'bad_par'.

EXAMPLE2
     # Pragmas.
     use strict;
     use warnings;

     # Modules.
     use Class::Params qw(params);
     use Data::Printer;

     # Definition.
     my $self = {};
     my $def_hr = {
             'par' =&gt; ['par', 'SCALAR', 1],
     };

     # Check.
     # output_structure, definition, array of pairs (key, value).
     params($self, $def_hr, ['par', 1]);

     # Dump $self.
     p $self;

     # Output:
     # \ {
     #     par   1
     # }

DEPENDENCIES
    Error::Pure, Exporter, Readonly, Scalar::Util.

REPOSITORY
    &lt;https://github.com/tupinek/Class-Params&gt;

AUTHOR
    Michal �麖a�嶤k skim@cpan.org

LICENSE AND COPYRIGHT
    BSD license.

VERSION
    0.02

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