tie

This function binds a variable to a package class that will provide the
implementation for the variable. VARIABLE is the name of the variable
to be enchanted. CLASSNAME is the name of a class implementing objects
of correct type. Any additional arguments are passed to the
appropriate constructor
method of the class (meaning TIESCALAR
, TIEHANDLE
, TIEARRAY
,
or TIEHASH
). Typically these are arguments such as might be passed
to the dbm_open(3) function of C. The object returned by the
constructor is also returned by the
tie function, which would be useful
if you want to access other methods in CLASSNAME.

Note that functions such as keys and
values may return huge lists when used on large
objects, like DBM files. You may prefer to use the each function to iterate over such. Example: