NetSDS::Util::Struct(3pm)

NetSDS::Util::Struct3pm

Data structure convertors

Usage

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

Overview

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

Exported methods

dump_to_string(...)

Returns cleaned dump to scalar.

dump_to_row(...)

Returns cleaned dump to scalar.

to_array($data)
arrays_to_hash($keys_ref, $values_ref) - translate arrays to hash

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'
        )
merge_hash($target, $source) - merge two hashes

Parameters: references to target and source hashes.

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

Examples

None

Todo

None

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 5 times.

  1. 6.0
  2. 7
  3. 8
  4. 9
  5. 10–11
  6. 12–13

Bugs

Unknown yet

Authors

Valentyn Solomko <[email protected]>

From libnetsds-util-perl 1.045-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.