{
    "content": [
        {
            "type": "text",
            "text": "# Tie::Array (perldoc)\n\n## NAME\n\nTie::Array - base class for tied arrays\n\n## SYNOPSIS\n\npackage Tie::NewArray;\nuse Tie::Array;\n@ISA = ('Tie::Array');\n# mandatory methods\nsub TIEARRAY { ... }\nsub FETCH { ... }\nsub FETCHSIZE { ... }\nsub STORE { ... }       # mandatory if elements writeable\nsub STORESIZE { ... }   # mandatory if elements can be added/deleted\nsub EXISTS { ... }      # mandatory if exists() expected to work\nsub DELETE { ... }      # mandatory if delete() expected to work\n# optional methods - for efficiency\nsub CLEAR { ... }\nsub PUSH { ... }\nsub POP { ... }\nsub SHIFT { ... }\nsub UNSHIFT { ... }\nsub SPLICE { ... }\nsub EXTEND { ... }\nsub DESTROY { ... }\npackage Tie::NewStdArray;\nuse Tie::Array;\n@ISA = ('Tie::StdArray');\n# all methods provided by default\npackage main;\n$object = tie @somearray,'Tie::NewArray';\n$object = tie @somearray,'Tie::StdArray';\n$object = tie @somearray,'Tie::NewStdArray';\n\n## DESCRIPTION\n\nThis module provides methods for array-tying classes. See perltie for a list of the functions\nrequired in order to tie an array to a package. The basic Tie::Array package provides stub\n\"DESTROY\", and \"EXTEND\" methods that do nothing, stub \"DELETE\" and \"EXISTS\" methods that croak()\nif the delete() or exists() builtins are ever called on the tied array, and implementations of\n\"PUSH\", \"POP\", \"SHIFT\", \"UNSHIFT\", \"SPLICE\" and \"CLEAR\" in terms of basic \"FETCH\", \"STORE\",\n\"FETCHSIZE\", \"STORESIZE\".\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **CAVEATS**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Tie::Array",
        "section": "",
        "mode": "perldoc",
        "summary": "Tie::Array - base class for tied arrays",
        "synopsis": "package Tie::NewArray;\nuse Tie::Array;\n@ISA = ('Tie::Array');\n# mandatory methods\nsub TIEARRAY { ... }\nsub FETCH { ... }\nsub FETCHSIZE { ... }\nsub STORE { ... }       # mandatory if elements writeable\nsub STORESIZE { ... }   # mandatory if elements can be added/deleted\nsub EXISTS { ... }      # mandatory if exists() expected to work\nsub DELETE { ... }      # mandatory if delete() expected to work\n# optional methods - for efficiency\nsub CLEAR { ... }\nsub PUSH { ... }\nsub POP { ... }\nsub SHIFT { ... }\nsub UNSHIFT { ... }\nsub SPLICE { ... }\nsub EXTEND { ... }\nsub DESTROY { ... }\npackage Tie::NewStdArray;\nuse Tie::Array;\n@ISA = ('Tie::StdArray');\n# all methods provided by default\npackage main;\n$object = tie @somearray,'Tie::NewArray';\n$object = tie @somearray,'Tie::StdArray';\n$object = tie @somearray,'Tie::NewStdArray';",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 37,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 82,
                "subsections": []
            },
            {
                "name": "CAVEATS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Tie::Array - base class for tied arrays\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "package Tie::NewArray;\nuse Tie::Array;\n@ISA = ('Tie::Array');\n\n# mandatory methods\nsub TIEARRAY { ... }\nsub FETCH { ... }\nsub FETCHSIZE { ... }\n\nsub STORE { ... }       # mandatory if elements writeable\nsub STORESIZE { ... }   # mandatory if elements can be added/deleted\nsub EXISTS { ... }      # mandatory if exists() expected to work\nsub DELETE { ... }      # mandatory if delete() expected to work\n\n# optional methods - for efficiency\nsub CLEAR { ... }\nsub PUSH { ... }\nsub POP { ... }\nsub SHIFT { ... }\nsub UNSHIFT { ... }\nsub SPLICE { ... }\nsub EXTEND { ... }\nsub DESTROY { ... }\n\npackage Tie::NewStdArray;\nuse Tie::Array;\n\n@ISA = ('Tie::StdArray');\n\n# all methods provided by default\n\npackage main;\n\n$object = tie @somearray,'Tie::NewArray';\n$object = tie @somearray,'Tie::StdArray';\n$object = tie @somearray,'Tie::NewStdArray';\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module provides methods for array-tying classes. See perltie for a list of the functions\nrequired in order to tie an array to a package. The basic Tie::Array package provides stub\n\"DESTROY\", and \"EXTEND\" methods that do nothing, stub \"DELETE\" and \"EXISTS\" methods that croak()\nif the delete() or exists() builtins are ever called on the tied array, and implementations of\n\"PUSH\", \"POP\", \"SHIFT\", \"UNSHIFT\", \"SPLICE\" and \"CLEAR\" in terms of basic \"FETCH\", \"STORE\",\n\"FETCHSIZE\", \"STORESIZE\".\n\nThe Tie::StdArray package provides efficient methods required for tied arrays which are\nimplemented as blessed references to an \"inner\" perl array. It inherits from Tie::Array, and\nshould cause tied arrays to behave exactly like standard arrays, allowing for selective\noverloading of methods.\n\nFor developers wishing to write their own tied arrays, the required methods are briefly defined\nbelow. See the perltie section for more detailed descriptive, as well as example code:\n\nTIEARRAY classname, LIST\nThe class method is invoked by the command \"tie @array, classname\". Associates an array\ninstance with the specified class. \"LIST\" would represent additional arguments (along the\nlines of AnyDBMFile and compatriots) needed to complete the association. The method should\nreturn an object of a class which provides the methods below.\n\nSTORE this, index, value\nStore datum *value* into *index* for the tied array associated with object *this*. If this\nmakes the array larger then class's mapping of \"undef\" should be returned for new positions.\n\nFETCH this, index\nRetrieve the datum in *index* for the tied array associated with object *this*.\n\nFETCHSIZE this\nReturns the total number of items in the tied array associated with object *this*.\n(Equivalent to \"scalar(@array)\").\n\nSTORESIZE this, count\nSets the total number of items in the tied array associated with object *this* to be\n*count*. If this makes the array larger then class's mapping of \"undef\" should be returned\nfor new positions. If the array becomes smaller then entries beyond count should be deleted.\n\nEXTEND this, count\nInformative call that array is likely to grow to have *count* entries. Can be used to\noptimize allocation. This method need do nothing.\n\nEXISTS this, key\nVerify that the element at index *key* exists in the tied array *this*.\n\nThe Tie::Array implementation is a stub that simply croaks.\n\nDELETE this, key\nDelete the element at index *key* from the tied array *this*.\n\nThe Tie::Array implementation is a stub that simply croaks.\n\nCLEAR this\nClear (remove, delete, ...) all values from the tied array associated with object *this*.\n\nDESTROY this\nNormal object destructor method.\n\nPUSH this, LIST\nAppend elements of LIST to the array.\n\nPOP this\nRemove last element of the array and return it.\n\nSHIFT this\nRemove the first element of the array (shifting other elements down) and return it.\n\nUNSHIFT this, LIST\nInsert LIST elements at the beginning of the array, moving existing elements up to make\nroom.\n\nSPLICE this, offset, length, LIST\nPerform the equivalent of \"splice\" on the array.\n\n*offset* is optional and defaults to zero, negative values count back from the end of the\narray.\n\n*length* is optional and defaults to rest of the array.\n\n*LIST* may be empty.\n\nReturns a list of the original *length* elements at *offset*.\n",
                "subsections": []
            },
            "CAVEATS": {
                "content": "There is no support at present for tied @ISA. There is a potential conflict between magic\nentries needed to notice setting of @ISA, and those needed to implement 'tie'.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Nick Ing-Simmons <nik@tiuk.ti.com>\n",
                "subsections": []
            }
        }
    }
}