MAN page from Old RedHat 5.X perl-5.004-4.i386.rpm
Tie::SubstrHash
Section: Perl Programmers Reference Guide (3)
Updated: perl 5.004, patch 04
Index NAME
Tie::SubstrHash - Fixed-table-size, fixed-key-length hashing
SYNOPSIS
require Tie::SubstrHash;
tie %myhash, 'Tie::SubstrHash', $key_len, $value_len, $table_size;
DESCRIPTION
The
Tie::SubstrHash package provides a hash-table-like interface toan array of determinate size, with constant key size and record size.
Upon tying a new hash to this package, the developer must specify thesize of the keys that will be used, the size of the value fields that thekeys will index, and the size of the overall table (in terms of key-valuepairs, not size in hard memory). These values will not change for theduration of the tied hash. The newly-allocated hash table may now havedata stored and retrieved. Efforts to store more than $table_sizeelements will result in a fatal error, as will efforts to store a valuenot exactly $value_len characters in length, or reference through akey not exactly $key_len characters in length. While these constraintsmay seem excessive, the result is a hash table using much less internalmemory than an equivalent freely-allocated hash table.
CAVEATS
Because the current implementation uses the table and key sizes for thehashing algorithm, there is no means by which to dynamically change thevalue of any of the initialization parameters.
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- CAVEATS
This document was created byman2html,using the manual pages.