---
name: "NetSDS::Util::Struct"
section: "3pm"
platform: "linux"
package: "libnetsds-util-perl"
version: "1.045-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/NetSDS::Util::Struct"
---

# NetSDS::Util::Struct(3pm)

data structure convertors

## 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

- **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

## BUGS

Unknown yet

## TODO

None

## SEE ALSO

None

## AUTHORS

Valentyn Solomko \<pere@pere.org.ua\>
