1Tie::SubstrHash(3pm)   Perl Programmers Reference Guide   Tie::SubstrHash(3pm)
2
3
4

NAME

6       Tie::SubstrHash - Fixed-table-size, fixed-key-length hashing
7

SYNOPSIS

9           require Tie::SubstrHash;
10
11           tie %myhash, 'Tie::SubstrHash', $key_len, $value_len, $table_size;
12

DESCRIPTION

14       The Tie::SubstrHash package provides a hash-table-like interface to an
15       array of determinate size, with constant key size and record size.
16
17       Upon tying a new hash to this package, the developer must specify the
18       size of the keys that will be used, the size of the value fields that
19       the keys will index, and the size of the overall table (in terms of
20       key-value pairs, not size in hard memory). These values will not change
21       for the duration of the tied hash. The newly-allocated hash table may
22       now have data stored and retrieved. Efforts to store more than
23       $table_size elements will result in a fatal error, as will efforts to
24       store a value not exactly $value_len characters in length, or reference
25       through a key not exactly $key_len characters in length. While these
26       constraints may seem excessive, the result is a hash table using much
27       less internal memory than an equivalent freely-allocated hash table.
28

CAVEATS

30       Because the current implementation uses the table and key sizes for the
31       hashing algorithm, there is no means by which to dynamically change the
32       value of any of the initialization parameters.
33
34       The hash does not support exists().
35
36
37
38perl v5.26.3                      2018-03-01              Tie::SubstrHash(3pm)
Impressum