Scroll to navigation

NetSDS::Util::Struct(3pm) User Contributed Perl Documentation NetSDS::Util::Struct(3pm)

NAME

NetSDS::Util::Struct - data structure convertors

SYNOPSIS

        use NetSDS::Util::Struct;
        ...
        my $str = dump_to_row($some_structure);

DESCRIPTION

NetSDS::Util::Struct module contains different utilities for data structures processing.

EXPORTED METHODS

Returns cleaned dump to scalar.
Returns cleaned dump to scalar.
Parameters: references to keys array and values array

Return: hash

If @$keys_ref is longer than @$values_ref - rest of keys filled with "undef" values.

If @$keys_ref is shorter than @$values_ref - rest of values are discarded.

If any of parameters isn't array reference then "undef" will return.

Example:

        my %h = array2hash(['fruit','animal'], ['apple','horse']);
    

Result should be a hash:

        (
                fruit => 'apple',
                animal => 'horse'
        )
    
Parameters: references to target and source hashes.

This method adds source hash to target one and return value as a result.

EXAMPLES

None

BUGS

Unknown yet

TODO

None

SEE ALSO

None

AUTHORS

Valentyn Solomko <pere@pere.org.ua>

2019-02-22 perl v5.28.1