Attempting to store a value for a key that doesn't exist is a fatal error.

In order to make any changes or modifications to the hash,
you must either keep the return value from strict_hash (or tie) or retrieve it by using tied %hash.
Think of it as the "key" that "unlocks" the hash so that you can make changes to it.

The original reason for writing this module was for classes that implement an object as a hash,
using hash members as instance variables.
It's all too easy to use the wrong member name,
with the same results as misspelling a variable name when use strict isn't in effect.

Note that just as use strict allows you to create new variables by either specifying an explicit package name or by using use vars,
a strict hash allows you to create or delete members by using the appropriate methods.
However,
it does prevent you from creating or deleting members accidentally.
This is in keeping with the general philosophy of Perl.

If you import the pseudo-symbol warn,
Tie::StrictHash will only issue warning messages rather than dying when an attempt is made to reference a hash value that doesn't exist.

If you import the pseudo-symbol confess,
either by itself or along with warn,
you'll get a stack backtrace as well when something happens.

This routine is exported by default,
and simply performs the tie statement listed next.
However,
it also preserves the original contents of %hash,
while calling tie directly does not.
However,
if you call untie%hash,
anything added since the call to strict_hash is lost and only the original contents will remain.

Sets %hash as a 'strict' hash,
and defines its initial contents.
The returned value $hashctl is used to make any modifications to the hash.
The original contents of the hash are lost when you call tie directly (although they come back if you untie the hash later).

Except for new,
these must be invoked by using the $hashctl object.
This is returned by strict_hash or tie,
or may be retrieved by using tied %hash at any time.

$hashref = new Tie::StrictHash key => value,
...;

Creates a new anonymous strict hash with the specified members as its initial contents.
The hash reference is both a reference to the hash and the hash control object.
It's possible to define an object with its 'instance variables' implemented in terms of a strict hash,
provided that the object inherits from Tie::StrictHash...in this case,
the object and its underlying hash would effectively belong to different classes!
This works because bless applies to the reference,
while tie applies to the actual thingy.

$hashctl->add(key => value,
...);

Adds the specified keys and values to %hash.

@values = $hashctl->delete(key,
...);

Deletes the named key(s) from %hash and returns them in @values.
They appear in @values in the same order as the keys are specified in the method call.