start page | rating of books | rating of authors | reviews | copyrights

Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: 8.157 Tie::Scalar, Tie::StdScalar Chapter 8
Standard Modules
Next: 8.159 Time::gmtime
 

8.158 Tie::SubstrHash

Provides a hash-table-like interface to a fixed-sized array that has a constant key size and record size.

require Tie::SubstrHash; tie %myhash, "Tie::SubstrHash", 
key_len
, 
value_len
, 
table_size
;
To tie a new hash to this package, specify the following:

key_len

Length of each key

value_len

Length of each value

table_size

Size of the table given as the number of key/value pairs

An attempt to store a key/value pair where either the key or the value is the wrong length, or where the resulting table would be greater than table_size , results in a fatal error.


Previous: 8.157 Tie::Scalar, Tie::StdScalar Perl in a Nutshell Next: 8.159 Time::gmtime
8.157 Tie::Scalar, Tie::StdScalar Book Index 8.159 Time::gmtime

Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.