Like this article? We recommend
Method Names
As stated earlier, Perl implicitly calls a class' methods when the variable is accessed. When tie() is invoked, it calls the appropriate TIESCALAR, TIEARRAY, TIEHASH, or TIEHANDLE method, depending on the type of variable being tied.
Following is an outline of some of the methods available for each type of tie. Keep these in mind while you read this article:
Hash methods:
- TIEHASH classname, LIST
- DESTROY this
- FETCH this, key
- STORE this, key, value
- DELETE this, key
- EXISTS this, key
- FIRSTKEY this
- NEXTKEY this, lastkey
Array methods:
- TIEARRAY classname, LIST
- DESTROY this
- FETCH this, key
- STORE this, key, value
Scalar methods:
- TIESCALAR classname, LIST
- DESTROY this
- FETCH this,
- STORE this, value
Filehandle methods:
- TIEHANDLE classname, LIST
- WRITE this, LIST
- PRINT this, LIST
- PRINTF this, LIST
- READ this, LIST
- READLINE this
- GETC this
- CLOSE this
- DESTROY this