{
    "content": [
        {
            "type": "text",
            "text": "# Clone (man)\n\n## NAME\n\nClone - recursively copy Perl datatypes\n\n## SYNOPSIS\n\nuse Clone 'clone';\nmy $data = {\nset => [ 1 .. 50 ],\nfoo => {\nanswer => 42,\nobject => SomeObject->new,\n},\n};\nmy $cloneddata = clone($data);\n$cloneddata->{foo}{answer} = 1;\nprint $cloneddata->{foo}{answer};  # '1'\nprint $data->{foo}{answer};         # '42'\nYou can also add it to your class:\npackage Foo;\nuse parent 'Clone';\nsub new { bless {}, shift }\npackage main;\nmy $obj = Foo->new;\nmy $copy = $obj->clone;\n\n## DESCRIPTION\n\nThis module provides a \"clone()\" method which makes recursive copies of nested hash, array,\nscalar and reference types, including tied variables and objects.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **SEE ALSO**\n- **COPYRIGHT**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Clone",
        "section": "",
        "mode": "man",
        "summary": "Clone - recursively copy Perl datatypes",
        "synopsis": "use Clone 'clone';\nmy $data = {\nset => [ 1 .. 50 ],\nfoo => {\nanswer => 42,\nobject => SomeObject->new,\n},\n};\nmy $cloneddata = clone($data);\n$cloneddata->{foo}{answer} = 1;\nprint $cloneddata->{foo}{answer};  # '1'\nprint $data->{foo}{answer};         # '42'\nYou can also add it to your class:\npackage Foo;\nuse parent 'Clone';\nsub new { bless {}, shift }\npackage main;\nmy $obj = Foo->new;\nmy $copy = $obj->clone;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 27,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 8,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Clone - recursively copy Perl datatypes\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Clone 'clone';\n\nmy $data = {\nset => [ 1 .. 50 ],\nfoo => {\nanswer => 42,\nobject => SomeObject->new,\n},\n};\n\nmy $cloneddata = clone($data);\n\n$cloneddata->{foo}{answer} = 1;\nprint $cloneddata->{foo}{answer};  # '1'\nprint $data->{foo}{answer};         # '42'\n\nYou can also add it to your class:\n\npackage Foo;\nuse parent 'Clone';\nsub new { bless {}, shift }\n\npackage main;\n\nmy $obj = Foo->new;\nmy $copy = $obj->clone;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module provides a \"clone()\" method which makes recursive copies of nested hash, array,\nscalar and reference types, including tied variables and objects.\n\n\"clone()\" takes a scalar argument and duplicates it. To duplicate lists, arrays or hashes,\npass them in by reference, e.g.\n\nmy $copy = clone (\\@array);\n\n# or\n\nmy %copy = %{ clone (\\%hash) };\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Storable's \"dclone()\" is a flexible solution for cloning variables, albeit slower for\naverage-sized data structures. Simple and naive benchmarks show that Clone is faster for data\nstructures with 3 or fewer levels, while \"dclone()\" can be faster for structures 4 or more\nlevels deep.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright 2001-2019 Ray Finch. All Rights Reserved.\n\nThis module is free software; you can redistribute it and/or modify it under the same terms\nas Perl itself.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Ray Finch \"<rdf@cpan.org>\"\n\nBreno G. de Oliveira \"<garu@cpan.org>\" and Florian Ragwitz \"<rafl@debian.org>\" perform\nroutine maintenance releases since 2012.\n\n\n\nperl v5.34.0                                 2022-02-06                                   Clone(3pm)",
                "subsections": []
            }
        }
    }
}