{
    "mode": "perldoc",
    "parameter": "Tie::Handle",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Tie%3A%3AHandle/json",
    "generated": "2026-06-13T21:28:59Z",
    "synopsis": "package NewHandle;\nrequire Tie::Handle;\n@ISA = qw(Tie::Handle);\nsub READ { ... }            # Provide a needed method\nsub TIEHANDLE { ... }       # Overrides inherited method\npackage main;\ntie *FH, 'NewHandle';",
    "sections": {
        "NAME": {
            "content": "Tie::Handle - base class definitions for tied handles\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "package NewHandle;\nrequire Tie::Handle;\n\n@ISA = qw(Tie::Handle);\n\nsub READ { ... }            # Provide a needed method\nsub TIEHANDLE { ... }       # Overrides inherited method\n\n\npackage main;\n\ntie *FH, 'NewHandle';\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module provides some skeletal methods for handle-tying classes. See perltie for a list of\nthe functions required in tying a handle to a package. The basic Tie::Handle package provides a\n\"new\" method, as well as methods \"TIEHANDLE\", \"PRINT\", \"PRINTF\" and \"GETC\".\n\nFor developers wishing to write their own tied-handle classes, the methods are summarized below.\nThe perltie section not only documents these, but has sample code as well:\n\nTIEHANDLE classname, LIST\nThe method invoked by the command \"tie *glob, classname\". Associates a new glob instance\nwith the specified class. \"LIST\" would represent additional arguments (along the lines of\nAnyDBMFile and compatriots) needed to complete the association.\n\nWRITE this, scalar, length, offset\nWrite *length* bytes of data from *scalar* starting at *offset*.\n\nPRINT this, LIST\nPrint the values in *LIST*\n\nPRINTF this, format, LIST\nPrint the values in *LIST* using *format*\n\nREAD this, scalar, length, offset\nRead *length* bytes of data into *scalar* starting at *offset*.\n\nREADLINE this\nRead a single line\n\nGETC this\nGet a single character\n\nCLOSE this\nClose the handle\n\nOPEN this, filename\n(Re-)open the handle\n\nBINMODE this\nSpecify content is binary\n\nEOF this\nTest for end of file.\n\nTELL this\nReturn position in the file.\n\nSEEK this, offset, whence\nPosition the file.\n\nTest for end of file.\n\nDESTROY this\nFree the storage associated with the tied handle referenced by *this*. This is rarely\nneeded, as Perl manages its memory quite well. But the option exists, should a class wish to\nperform specific actions upon the destruction of an instance.\n",
            "subsections": []
        },
        "MORE INFORMATION": {
            "content": "The perltie section contains an example of tying handles.\n",
            "subsections": []
        },
        "COMPATIBILITY": {
            "content": "This version of Tie::Handle is neither related to nor compatible with the Tie::Handle (3.0)\nmodule available on CPAN. It was due to an accident that two modules with the same name\nappeared. The namespace clash has been cleared in favor of this module that comes with the perl\ncore in September 2000 and accordingly the version number has been bumped up to 4.0.\n",
            "subsections": []
        }
    },
    "summary": "Tie::Handle - base class definitions for tied handles",
    "flags": [],
    "examples": [],
    "see_also": []
}