Skip to content

damil/Hash-Type

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hash/Type version 2.0
======================

Hash::Type - restricted, ordered hashes as arrays tied to a "type"
             (shared list of keys)


An instance of C<Hash::Type>  encapsulates a collection of field names,
and is used to generate tied hashes, implemented internally as arrayrefs,
and sharing the common list of fields.

The original motivation for this design was to spare memory, since the
field names are shared. As it turns out, benchmarks show that this
goal is not attained : memory usage is about 35% higher than Perl
native hashes.  However, this module also implements B<restricted
hashes> (hashes with a fixed set of keys that cannot be expanded) and
of B<ordered hashes> (the list of keys or list values are returned in
a fixed order); and for those two functionalities, the performances of
C<Hash::Type> are very competitive with respect to those of other
similar modules, both in terms of CPU and memory usage (see the
L</"BENCHMARKS"> section at the end of the documentation). In
addition, C<Hash::Type> offers an API for B<convenient and very
efficient sorting> of lists of tied hashes, and alternative
methods for C<keys>, C<values> and C<each>, faster than the L</perltie>
API.

In conclusion, this module is well suited for any need of restricted
and/or ordered hashes, and for situations dealing with large
collections of homogeneous hashes, like for example data rows coming from
spreadsheets or databases.


INSTALLATION

To install this module type the following:

   perl Makefile.PL
   make
   make test
   make install

DEPENDENCIES

None

COPYRIGHT AND LICENCE

Copyright (C) 2004-2016 Laurent Dami

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself. 

About

pseudo-hashes as arrays tied to a "type" (list of fields)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages