in reply to Perl : Hash Dump Packages?
If you haven't stored references as hash values, you can use my $box = pack "(Z*)*", %hash; to deflate the hash and my %hash = unpack "(Z*)*", $box; to inflate it again.
If your data contains nul bytes or you need to avoid them altogether you'll want a pack format with a counter, such as (A8/A*)* maybe, which will consume more space and impose a limit on the maximum length of keys and values.
Both of those will turn undef values into empty strings.
If you have nested data structures, implementing your own gets complex quick; see aforementioned posts for suggestions.
It all depends on your needs.
Makeshifts last the longest.
|
|---|