Perl Programming/Keywords/tie

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Previous: telldir Keywords Next: tied

The tie keyword[edit | edit source]

tie function binds a variable to a package class that will provide the implementation for it. VARIABLE is the name of the variable to be enchanted. CLASSNAME is the name of a class implementing objects of the correct type. All other arguments are passed to the appropriate constructor method of the class (so that they mean TIESCALAR, TIEHANDLE, TIEARRAY, or TIEHASH).

Syntax[edit | edit source]

  tie VARIABLE, CLASSNAME, LIST

See also[edit | edit source]

Previous: telldir Keywords Next: tied