NetSDS...Struct(3pm)

πŸ“¦
version 1.045 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

πŸ’– NetSDS::Util::Struct β€” the manual, but make it cute πŸ’–

okay bestie so this page you're reading? it's the manual for NetSDS::Util::Struct, filed under the manual name NetSDS...Struct(3pm) β€” yes that's really how it's spelled up top, the name got chopped, that's just the vibe, don't @ me. 🌸


✨ NAME ✨

NetSDS::Util::Struct β€” data structure convertors πŸ¦‹


🌈 SYNOPSIS 🌈

use NetSDS::Util::Struct;

...

my $str = dump_to_row($some_structure);

that's it, that's the whole entrance exam πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

the NetSDS::Util::Struct module is literally just a little grab-bag of different utilities for data structures processing. it's giving toolbox energy. 🧰✨


πŸ‘‘ EXPORTED METHODS πŸ‘‘

  • dump_to_string(...) β€” Returns cleaned dump to scalar. 🫢
  • dump_to_row(...) β€” Returns cleaned dump to scalar. (yes, same one-liner as the one above, no cap, that's what the manual says 😭)
  • to_array($data) β€” that's the whole thing, bestie. no description was ever written for this one. it exists, it takes $data, and that's all we know. iconic mystery honestly πŸ’€
  • arrays_to_hash($keys_ref, $values_ref) β€” translate arrays to hash. 🌸

Parameters: references to keys array and values array.

Return: hash.

Now the important bits, pay attention bestie:

  • If @$keys_ref is longer than @$values_ref β€” the rest of keys filled with "undef" values. πŸ™ˆ
  • If @$keys_ref is shorter than @$values_ref β€” the 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

not a single one. we're on our own out here fr fr 😭

πŸ¦‹ BUGS πŸ¦‹

Unknown yet

unknown yet, bestie. they're out there. lurking. lowkey ominous ngl πŸ’€

⭐ TODO ⭐

None


🌟 SEE ALSO 🌟

None

no friends, no cross-references, no nothing. this module is on its main character solo arc πŸ‘‘

πŸ’– AUTHORS πŸ’–

Valentyn Solomko <pere@pere.org.ua>


and that's the whole page, babe 🫢 this one shipped with perl v5.36.0, dated 2022-11-20, and the manual name stamped on it is NetSDS...Struct(3pm). go forth and convert your data structures, you absolute legend βœ¨πŸŒΈπŸ’…

πŸ“¦ where this page comes from