Data::Hive::Store::Hash - store a hive in a flat hashref
version 1.015
This is a simple store, primarily for testing, that will store hives in a flat hashref. Paths are packed into strings and used as keys. The structure does not recurse -- for that, see Data::Hive::Store::Hash::Nested.
So, we could do this:
my $href = {}; my $hive = Data::Hive->NEW({ store_class => 'Hash', store_args => [ $href ], }); $hive->foo->SET(1); $hive->foo->bar->baz->SET(2);
We would end up with $href containing something like:
$href
{ foo => 1, 'foo.bar.baz' => 2 }
This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years.
Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl.
my $store = Data::Hive::Store::Hash->new(\%hash, \%arg);
The only argument expected for new is a hashref, which is the hashref in which hive entries are stored.
new
If no hashref is provided, a new, empty hashref will be used.
The extra arguments may include:
A Data::Hive::PathPacker-like object used to convert between paths (arrayrefs) and hash keys.
This method returns the hashref in which things are being used. You should not alter its contents!
Hans Dieter Pearcey <hdp@cpan.org>
Ricardo Signes <cpan@semiotic.systems>
This software is copyright (c) 2006 by Hans Dieter Pearcey.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Data::Hive, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Hive
CPAN shell
perl -MCPAN -e shell install Data::Hive
For more information on module installation, please visit the detailed CPAN module installation guide.