{
    "content": [
        {
            "type": "text",
            "text": "# Data::Dumper (perldoc)\n\n## NAME\n\nData::Dumper - stringified perl data structures, suitable for both printing and \"eval\"\n\n## SYNOPSIS\n\nuse Data::Dumper;\n# simple procedural interface\nprint Dumper($foo, $bar);\n# extended usage with names\nprint Data::Dumper->Dump([$foo, $bar], [qw(foo *ary)]);\n# configuration variables\n{\nlocal $Data::Dumper::Purity = 1;\neval Data::Dumper->Dump([$foo, $bar], [qw(foo *ary)]);\n}\n# OO usage\n$d = Data::Dumper->new([$foo, $bar], [qw(foo *ary)]);\n...\nprint $d->Dump;\n...\n$d->Purity(1)->Terse(1)->Deepcopy(1);\neval $d->Dump;\n\n## DESCRIPTION\n\nGiven a list of scalars or reference variables, writes out their contents in perl syntax. The\nreferences can also be objects. The content of each variable is output in a single Perl\nstatement. Handles self-referential structures correctly.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (4 subsections)\n- **EXAMPLES**\n- **BUGS**\n- **AUTHOR**\n- **VERSION**\n- **SEE ALSO** (1 subsections)\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Data::Dumper",
        "section": "",
        "mode": "perldoc",
        "summary": "Data::Dumper - stringified perl data structures, suitable for both printing and \"eval\"",
        "synopsis": "use Data::Dumper;\n# simple procedural interface\nprint Dumper($foo, $bar);\n# extended usage with names\nprint Data::Dumper->Dump([$foo, $bar], [qw(foo *ary)]);\n# configuration variables\n{\nlocal $Data::Dumper::Purity = 1;\neval Data::Dumper->Dump([$foo, $bar], [qw(foo *ary)]);\n}\n# OO usage\n$d = Data::Dumper->new([$foo, $bar], [qw(foo *ary)]);\n...\nprint $d->Dump;\n...\n$d->Purity(1)->Terse(1)->Deepcopy(1);\neval $d->Dump;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "Run these code snippets to get a quick feel for the behavior of this module. When you are",
            "through with these examples, you may want to add or change the various configuration variables",
            "described above, to see their behavior. (See the testsuite in the Data::Dumper distribution for",
            "more examples.)",
            "use Data::Dumper;",
            "package Foo;",
            "sub new {bless {'a' => 1, 'b' => sub { return \"foo\" }}, $[0]};",
            "package Fuz;                       # a weird REF-REF-SCALAR object",
            "sub new {bless \\($ = \\ 'fu\\'z'), $[0]};",
            "package main;",
            "$foo = Foo->new;",
            "$fuz = Fuz->new;",
            "$boo = [ 1, [], \"abcd\", \\*foo,",
            "{1 => 'a', 023 => 'b', 0x45 => 'c'},",
            "\\\\\"p\\q\\'r\", $foo, $fuz];",
            "########",
            "# simple usage",
            "########",
            "$bar = eval(Dumper($boo));",
            "print($@) if $@;",
            "print Dumper($boo), Dumper($bar);  # pretty print (no array indices)",
            "$Data::Dumper::Terse = 1;        # don't output names where feasible",
            "$Data::Dumper::Indent = 0;       # turn off all pretty print",
            "print Dumper($boo), \"\\n\";",
            "$Data::Dumper::Indent = 1;       # mild pretty print",
            "print Dumper($boo);",
            "$Data::Dumper::Indent = 3;       # pretty print with array indices",
            "print Dumper($boo);",
            "$Data::Dumper::Useqq = 1;        # print strings in double quotes",
            "print Dumper($boo);",
            "$Data::Dumper::Pair = \" : \";     # specify hash key/value separator",
            "print Dumper($boo);",
            "########",
            "# recursive structures",
            "########",
            "@c = ('c');",
            "$c = \\@c;",
            "$b = {};",
            "$a = [1, $b, $c];",
            "$b->{a} = $a;",
            "$b->{b} = $a->[1];",
            "$b->{c} = $a->[2];",
            "print Data::Dumper->Dump([$a,$b,$c], [qw(a b c)]);",
            "$Data::Dumper::Purity = 1;         # fill in the holes for eval",
            "print Data::Dumper->Dump([$a, $b], [qw(*a b)]); # print as @a",
            "print Data::Dumper->Dump([$b, $a], [qw(*b a)]); # print as %b",
            "$Data::Dumper::Deepcopy = 1;       # avoid cross-refs",
            "print Data::Dumper->Dump([$b, $a], [qw(*b a)]);",
            "$Data::Dumper::Purity = 0;         # avoid cross-refs",
            "print Data::Dumper->Dump([$b, $a], [qw(*b a)]);",
            "########",
            "# deep structures",
            "########",
            "$a = \"pearl\";",
            "$b = [ $a ];",
            "$c = { 'b' => $b };",
            "$d = [ $c ];",
            "$e = { 'd' => $d };",
            "$f = { 'e' => $e };",
            "print Data::Dumper->Dump([$f], [qw(f)]);",
            "$Data::Dumper::Maxdepth = 3;       # no deeper than 3 refs down",
            "print Data::Dumper->Dump([$f], [qw(f)]);",
            "########",
            "# object-oriented usage",
            "########",
            "$d = Data::Dumper->new([$a,$b], [qw(a b)]);",
            "$d->Seen({'*c' => $c});            # stash a ref without printing it",
            "$d->Indent(3);",
            "print $d->Dump;",
            "$d->Reset->Purity(0);              # empty the seen cache",
            "print join \"----\\n\", $d->Dump;",
            "########",
            "# persistence",
            "########",
            "package Foo;",
            "sub new { bless { state => 'awake' }, shift }",
            "sub Freeze {",
            "my $s = shift;",
            "print STDERR \"preparing to sleep\\n\";",
            "$s->{state} = 'asleep';",
            "return bless $s, 'Foo::ZZZ';",
            "package Foo::ZZZ;",
            "sub Thaw {",
            "my $s = shift;",
            "print STDERR \"waking up\\n\";",
            "$s->{state} = 'awake';",
            "return bless $s, 'Foo';",
            "package main;",
            "use Data::Dumper;",
            "$a = Foo->new;",
            "$b = Data::Dumper->new([$a], ['c']);",
            "$b->Freezer('Freeze');",
            "$b->Toaster('Thaw');",
            "$c = $b->Dump;",
            "print $c;",
            "$d = eval $c;",
            "print Data::Dumper->Dump([$d], ['d']);",
            "########",
            "# symbol substitution (useful for recreating CODE refs)",
            "########",
            "sub foo { print \"foo speaking\\n\" }",
            "*other = \\&foo;",
            "$bar = [ \\&other ];",
            "$d = Data::Dumper->new([\\&other,$bar],['*other','bar']);",
            "$d->Seen({ '*foo' => \\&foo });",
            "print $d->Dump;",
            "########",
            "# sorting and filtering hash keys",
            "########",
            "$Data::Dumper::Sortkeys = \\&myfilter;",
            "my $foo = { map { (ord, \"$$$\") } 'I'..'Q' };",
            "my $bar = { %$foo };",
            "my $baz = { reverse %$foo };",
            "print Dumper [ $foo, $bar, $baz ];",
            "sub myfilter {",
            "my ($hash) = @;",
            "# return an array ref containing the hash keys to dump",
            "# in the order that you want them to be dumped",
            "return [",
            "# Sort the keys of %$foo in reverse numeric order",
            "$hash eq $foo ? (sort {$b <=> $a} keys %$hash) :",
            "# Only dump the odd number keys of %$bar",
            "$hash eq $bar ? (grep {$ % 2} keys %$hash) :",
            "# Sort keys in default order for all other hashes",
            "(sort keys %$hash)",
            "];"
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 31,
                "subsections": [
                    {
                        "name": "Methods",
                        "lines": 52
                    },
                    {
                        "name": "Functions",
                        "lines": 5
                    },
                    {
                        "name": "Configuration Variables or Methods",
                        "lines": 164
                    },
                    {
                        "name": "Exports",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "EXAMPLES",
                "lines": 168,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 26,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 1,
                "subsections": [
                    {
                        "name": "perl",
                        "lines": 1
                    }
                ]
            }
        ],
        "sections": {
            "NAME": {
                "content": "Data::Dumper - stringified perl data structures, suitable for both printing and \"eval\"\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Data::Dumper;\n\n# simple procedural interface\nprint Dumper($foo, $bar);\n\n# extended usage with names\nprint Data::Dumper->Dump([$foo, $bar], [qw(foo *ary)]);\n\n# configuration variables\n{\nlocal $Data::Dumper::Purity = 1;\neval Data::Dumper->Dump([$foo, $bar], [qw(foo *ary)]);\n}\n\n# OO usage\n$d = Data::Dumper->new([$foo, $bar], [qw(foo *ary)]);\n...\nprint $d->Dump;\n...\n$d->Purity(1)->Terse(1)->Deepcopy(1);\neval $d->Dump;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Given a list of scalars or reference variables, writes out their contents in perl syntax. The\nreferences can also be objects. The content of each variable is output in a single Perl\nstatement. Handles self-referential structures correctly.\n\nThe return value can be \"eval\"ed to get back an identical copy of the original reference\nstructure. (Please do consider the security implications of eval'ing code from untrusted\nsources!)\n\nAny references that are the same as one of those passed in will be named $VAR*n* (where *n* is a\nnumeric suffix), and other duplicate references to substructures within $VAR*n* will be\nappropriately labeled using arrow notation. You can specify names for individual values to be\ndumped if you use the \"Dump()\" method, or you can change the default $VAR prefix to something\nelse. See $Data::Dumper::Varname and $Data::Dumper::Terse below.\n\nThe default output of self-referential structures can be \"eval\"ed, but the nested references to\n$VAR*n* will be undefined, since a recursive structure cannot be constructed using one Perl\nstatement. You should set the \"Purity\" flag to 1 to get additional statements that will\ncorrectly fill in these references. Moreover, if \"eval\"ed when strictures are in effect, you\nneed to ensure that any variables it accesses are previously declared.\n\nIn the extended usage form, the references to be dumped can be given user-specified names. If a\nname begins with a \"*\", the output will describe the dereferenced type of the supplied reference\nfor hashes and arrays, and coderefs. Output of names will be avoided where possible if the\n\"Terse\" flag is set.\n\nIn many cases, methods that are used to set the internal state of the object will return the\nobject itself, so method calls can be conveniently chained together.\n\nSeveral styles of output are possible, all controlled by setting the \"Indent\" flag. See\n\"Configuration Variables or Methods\" below for details.\n",
                "subsections": [
                    {
                        "name": "Methods",
                        "content": "*PACKAGE*->new(*ARRAYREF [*, *ARRAYREF]*)\nReturns a newly created \"Data::Dumper\" object. The first argument is an anonymous array of\nvalues to be dumped. The optional second argument is an anonymous array of names for the\nvalues. The names need not have a leading \"$\" sign, and must be comprised of alphanumeric\ncharacters. You can begin a name with a \"*\" to specify that the dereferenced type must be\ndumped instead of the reference itself, for ARRAY and HASH references.\n\nThe prefix specified by $Data::Dumper::Varname will be used with a numeric suffix if the\nname for a value is undefined.\n\nData::Dumper will catalog all references encountered while dumping the values.\nCross-references (in the form of names of substructures in perl syntax) will be inserted at\nall possible points, preserving any structural interdependencies in the original set of\nvalues. Structure traversal is depth-first, and proceeds in order from the first supplied\nvalue to the last.\n\n*$OBJ*->Dump *or* *PACKAGE*->Dump(*ARRAYREF [*, *ARRAYREF]*)\nReturns the stringified form of the values stored in the object (preserving the order in\nwhich they were supplied to \"new\"), subject to the configuration options below. In a list\ncontext, it returns a list of strings corresponding to the supplied values.\n\nThe second form, for convenience, simply calls the \"new\" method on its arguments before\ndumping the object immediately.\n\n*$OBJ*->Seen(*[HASHREF]*)\nQueries or adds to the internal table of already encountered references. You must use\n\"Reset\" to explicitly clear the table if needed. Such references are not dumped; instead,\ntheir names are inserted wherever they are encountered subsequently. This is useful\nespecially for properly dumping subroutine references.\n\nExpects an anonymous hash of name => value pairs. Same rules apply for names as in \"new\". If\nno argument is supplied, will return the \"seen\" list of name => value pairs, in a list\ncontext. Otherwise, returns the object itself.\n\n*$OBJ*->Values(*[ARRAYREF]*)\nQueries or replaces the internal array of values that will be dumped. When called without\narguments, returns the values as a list. When called with a reference to an array of\nreplacement values, returns the object itself. When called with any other type of argument,\ndies.\n\n*$OBJ*->Names(*[ARRAYREF]*)\nQueries or replaces the internal array of user supplied names for the values that will be\ndumped. When called without arguments, returns the names. When called with an array of\nreplacement names, returns the object itself. If the number of replacement names exceeds the\nnumber of values to be named, the excess names will not be used. If the number of\nreplacement names falls short of the number of values to be named, the list of replacement\nnames will be exhausted and remaining values will not be renamed. When called with any other\ntype of argument, dies.\n\n*$OBJ*->Reset\nClears the internal table of \"seen\" references and returns the object itself.\n"
                    },
                    {
                        "name": "Functions",
                        "content": "Dumper(*LIST*)\nReturns the stringified form of the values in the list, subject to the configuration options\nbelow. The values will be named $VAR*n* in the output, where *n* is a numeric suffix. Will\nreturn a list of strings in a list context.\n"
                    },
                    {
                        "name": "Configuration Variables or Methods",
                        "content": "Several configuration variables can be used to control the kind of output generated when using\nthe procedural interface. These variables are usually \"local\"ized in a block so that other parts\nof the code are not affected by the change.\n\nThese variables determine the default state of the object created by calling the \"new\" method,\nbut cannot be used to alter the state of the object thereafter. The equivalent method names\nshould be used instead to query or set the internal state of the object.\n\nThe method forms return the object itself when called with arguments, so that they can be\nchained together nicely.\n\n*   $Data::Dumper::Indent *or* *$OBJ*->Indent(*[NEWVAL]*)\n\nControls the style of indentation. It can be set to 0, 1, 2 or 3. Style 0 spews output\nwithout any newlines, indentation, or spaces between list items. It is the most compact\nformat possible that can still be called valid perl. Style 1 outputs a readable form with\nnewlines but no fancy indentation (each level in the structure is simply indented by a fixed\namount of whitespace). Style 2 (the default) outputs a very readable form which lines up the\nhash keys. Style 3 is like style 2, but also annotates the elements of arrays with their\nindex (but the comment is on its own line, so array output consumes twice the number of\nlines). Style 2 is the default.\n\n*   $Data::Dumper::Trailingcomma *or* *$OBJ*->Trailingcomma(*[NEWVAL]*)\n\nControls whether a comma is added after the last element of an array or hash. Even when\ntrue, no comma is added between the last element of an array or hash and a closing bracket\nwhen they appear on the same line. The default is false.\n\n*   $Data::Dumper::Purity *or* *$OBJ*->Purity(*[NEWVAL]*)\n\nControls the degree to which the output can be \"eval\"ed to recreate the supplied reference\nstructures. Setting it to 1 will output additional perl statements that will correctly\nrecreate nested references. The default is 0.\n\n*   $Data::Dumper::Pad *or* *$OBJ*->Pad(*[NEWVAL]*)\n\nSpecifies the string that will be prefixed to every line of the output. Empty string by\ndefault.\n\n*   $Data::Dumper::Varname *or* *$OBJ*->Varname(*[NEWVAL]*)\n\nContains the prefix to use for tagging variable names in the output. The default is \"VAR\".\n\n*   $Data::Dumper::Useqq *or* *$OBJ*->Useqq(*[NEWVAL]*)\n\nWhen set, enables the use of double quotes for representing string values. Whitespace other\nthan space will be represented as \"[\\n\\t\\r]\", \"unsafe\" characters will be backslashed, and\nunprintable characters will be output as quoted octal integers. The default is 0.\n\n*   $Data::Dumper::Terse *or* *$OBJ*->Terse(*[NEWVAL]*)\n\nWhen set, Data::Dumper will emit single, non-self-referential values as atoms/terms rather\nthan statements. This means that the $VAR*n* names will be avoided where possible, but be\nadvised that such output may not always be parseable by \"eval\".\n\n*   $Data::Dumper::Freezer *or* $*OBJ*->Freezer(*[NEWVAL]*)\n\nCan be set to a method name, or to an empty string to disable the feature. Data::Dumper will\ninvoke that method via the object before attempting to stringify it. This method can alter\nthe contents of the object (if, for instance, it contains data allocated from C), and even\nrebless it in a different package. The client is responsible for making sure the specified\nmethod can be called via the object, and that the object ends up containing only perl data\ntypes after the method has been called. Defaults to an empty string.\n\nIf an object does not support the method specified (determined using UNIVERSAL::can()) then\nthe call will be skipped. If the method dies a warning will be generated.\n\n*   $Data::Dumper::Toaster *or* $*OBJ*->Toaster(*[NEWVAL]*)\n\nCan be set to a method name, or to an empty string to disable the feature. Data::Dumper will\nemit a method call for any objects that are to be dumped using the syntax \"bless(DATA,\nCLASS)->METHOD()\". Note that this means that the method specified will have to perform any\nmodifications required on the object (like creating new state within it, and/or reblessing\nit in a different package) and then return it. The client is responsible for making sure the\nmethod can be called via the object, and that it returns a valid object. Defaults to an\nempty string.\n\n*   $Data::Dumper::Deepcopy *or* $*OBJ*->Deepcopy(*[NEWVAL]*)\n\nCan be set to a boolean value to enable deep copies of structures. Cross-referencing will\nthen only be done when absolutely essential (i.e., to break reference cycles). Default is 0.\n\n*   $Data::Dumper::Quotekeys *or* $*OBJ*->Quotekeys(*[NEWVAL]*)\n\nCan be set to a boolean value to control whether hash keys are quoted. A defined false value\nwill avoid quoting hash keys when it looks like a simple string. Default is 1, which will\nalways enclose hash keys in quotes.\n\n*   $Data::Dumper::Bless *or* $*OBJ*->Bless(*[NEWVAL]*)\n\nCan be set to a string that specifies an alternative to the \"bless\" builtin operator used to\ncreate objects. A function with the specified name should exist, and should accept the same\narguments as the builtin. Default is \"bless\".\n\n*   $Data::Dumper::Pair *or* $*OBJ*->Pair(*[NEWVAL]*)\n\nCan be set to a string that specifies the separator between hash keys and values. To dump\nnested hash, array and scalar values to JavaScript, use: \"$Data::Dumper::Pair = ' : ';\".\nImplementing \"bless\" in JavaScript is left as an exercise for the reader. A function with\nthe specified name exists, and accepts the same arguments as the builtin.\n\nDefault is: \" => \".\n\n*   $Data::Dumper::Maxdepth *or* $*OBJ*->Maxdepth(*[NEWVAL]*)\n\nCan be set to a positive integer that specifies the depth beyond which we don't venture into\na structure. Has no effect when \"Data::Dumper::Purity\" is set. (Useful in debugger when we\noften don't want to see more than enough). Default is 0, which means there is no maximum\ndepth.\n\n*   $Data::Dumper::Maxrecurse *or* $*OBJ*->Maxrecurse(*[NEWVAL]*)\n\nCan be set to a positive integer that specifies the depth beyond which recursion into a\nstructure will throw an exception. This is intended as a security measure to prevent perl\nrunning out of stack space when dumping an excessively deep structure. Can be set to 0 to\nremove the limit. Default is 1000.\n\n*   $Data::Dumper::Useperl *or* $*OBJ*->Useperl(*[NEWVAL]*)\n\nCan be set to a boolean value which controls whether the pure Perl implementation of\n\"Data::Dumper\" is used. The \"Data::Dumper\" module is a dual implementation, with almost all\nfunctionality written in both pure Perl and also in XS ('C'). Since the XS version is much\nfaster, it will always be used if possible. This option lets you override the default\nbehavior, usually for testing purposes only. Default is 0, which means the XS implementation\nwill be used if possible.\n\n*   $Data::Dumper::Sortkeys *or* $*OBJ*->Sortkeys(*[NEWVAL]*)\n\nCan be set to a boolean value to control whether hash keys are dumped in sorted order. A\ntrue value will cause the keys of all hashes to be dumped in Perl's default sort order. Can\nalso be set to a subroutine reference which will be called for each hash that is dumped. In\nthis case \"Data::Dumper\" will call the subroutine once for each hash, passing it the\nreference of the hash. The purpose of the subroutine is to return a reference to an array of\nthe keys that will be dumped, in the order that they should be dumped. Using this feature,\nyou can control both the order of the keys, and which keys are actually used. In other\nwords, this subroutine acts as a filter by which you can exclude certain keys from being\ndumped. Default is 0, which means that hash keys are not sorted.\n\n*   $Data::Dumper::Deparse *or* $*OBJ*->Deparse(*[NEWVAL]*)\n\nCan be set to a boolean value to control whether code references are turned into perl source\ncode. If set to a true value, \"B::Deparse\" will be used to get the source of the code\nreference. In older versions, using this option imposed a significant performance penalty\nwhen dumping parts of a data structure other than code references, but that is no longer the\ncase.\n\nCaution : use this option only if you know that your coderefs will be properly reconstructed\nby \"B::Deparse\".\n\n*   $Data::Dumper::Sparseseen *or* $*OBJ*->Sparseseen(*[NEWVAL]*)\n\nBy default, Data::Dumper builds up the \"seen\" hash of scalars that it has encountered during\nserialization. This is very expensive. This seen hash is necessary to support and even just\ndetect circular references. It is exposed to the user via the \"Seen()\" call both for writing\nand reading.\n\nIf you, as a user, do not need explicit access to the \"seen\" hash, then you can set the\n\"Sparseseen\" option to allow Data::Dumper to eschew building the \"seen\" hash for scalars\nthat are known not to possess more than one reference. This speeds up serialization\nconsiderably if you use the XS implementation.\n\nNote: If you turn on \"Sparseseen\", then you must not rely on the content of the seen hash\nsince its contents will be an implementation detail!\n"
                    },
                    {
                        "name": "Exports",
                        "content": "Dumper\n"
                    }
                ]
            },
            "EXAMPLES": {
                "content": "Run these code snippets to get a quick feel for the behavior of this module. When you are\nthrough with these examples, you may want to add or change the various configuration variables\ndescribed above, to see their behavior. (See the testsuite in the Data::Dumper distribution for\nmore examples.)\n\nuse Data::Dumper;\n\npackage Foo;\nsub new {bless {'a' => 1, 'b' => sub { return \"foo\" }}, $[0]};\n\npackage Fuz;                       # a weird REF-REF-SCALAR object\nsub new {bless \\($ = \\ 'fu\\'z'), $[0]};\n\npackage main;\n$foo = Foo->new;\n$fuz = Fuz->new;\n$boo = [ 1, [], \"abcd\", \\*foo,\n{1 => 'a', 023 => 'b', 0x45 => 'c'},\n\\\\\"p\\q\\'r\", $foo, $fuz];\n\n########\n# simple usage\n########\n\n$bar = eval(Dumper($boo));\nprint($@) if $@;\nprint Dumper($boo), Dumper($bar);  # pretty print (no array indices)\n\n$Data::Dumper::Terse = 1;        # don't output names where feasible\n$Data::Dumper::Indent = 0;       # turn off all pretty print\nprint Dumper($boo), \"\\n\";\n\n$Data::Dumper::Indent = 1;       # mild pretty print\nprint Dumper($boo);\n\n$Data::Dumper::Indent = 3;       # pretty print with array indices\nprint Dumper($boo);\n\n$Data::Dumper::Useqq = 1;        # print strings in double quotes\nprint Dumper($boo);\n\n$Data::Dumper::Pair = \" : \";     # specify hash key/value separator\nprint Dumper($boo);\n\n\n########\n# recursive structures\n########\n\n@c = ('c');\n$c = \\@c;\n$b = {};\n$a = [1, $b, $c];\n$b->{a} = $a;\n$b->{b} = $a->[1];\n$b->{c} = $a->[2];\nprint Data::Dumper->Dump([$a,$b,$c], [qw(a b c)]);\n\n\n$Data::Dumper::Purity = 1;         # fill in the holes for eval\nprint Data::Dumper->Dump([$a, $b], [qw(*a b)]); # print as @a\nprint Data::Dumper->Dump([$b, $a], [qw(*b a)]); # print as %b\n\n\n$Data::Dumper::Deepcopy = 1;       # avoid cross-refs\nprint Data::Dumper->Dump([$b, $a], [qw(*b a)]);\n\n\n$Data::Dumper::Purity = 0;         # avoid cross-refs\nprint Data::Dumper->Dump([$b, $a], [qw(*b a)]);\n\n########\n# deep structures\n########\n\n$a = \"pearl\";\n$b = [ $a ];\n$c = { 'b' => $b };\n$d = [ $c ];\n$e = { 'd' => $d };\n$f = { 'e' => $e };\nprint Data::Dumper->Dump([$f], [qw(f)]);\n\n$Data::Dumper::Maxdepth = 3;       # no deeper than 3 refs down\nprint Data::Dumper->Dump([$f], [qw(f)]);\n\n\n########\n# object-oriented usage\n########\n\n$d = Data::Dumper->new([$a,$b], [qw(a b)]);\n$d->Seen({'*c' => $c});            # stash a ref without printing it\n$d->Indent(3);\nprint $d->Dump;\n$d->Reset->Purity(0);              # empty the seen cache\nprint join \"----\\n\", $d->Dump;\n\n\n########\n# persistence\n########\n\npackage Foo;\nsub new { bless { state => 'awake' }, shift }\nsub Freeze {\nmy $s = shift;\nprint STDERR \"preparing to sleep\\n\";\n$s->{state} = 'asleep';\nreturn bless $s, 'Foo::ZZZ';\n}\n\npackage Foo::ZZZ;\nsub Thaw {\nmy $s = shift;\nprint STDERR \"waking up\\n\";\n$s->{state} = 'awake';\nreturn bless $s, 'Foo';\n}\n\npackage main;\nuse Data::Dumper;\n$a = Foo->new;\n$b = Data::Dumper->new([$a], ['c']);\n$b->Freezer('Freeze');\n$b->Toaster('Thaw');\n$c = $b->Dump;\nprint $c;\n$d = eval $c;\nprint Data::Dumper->Dump([$d], ['d']);\n\n\n########\n# symbol substitution (useful for recreating CODE refs)\n########\n\nsub foo { print \"foo speaking\\n\" }\n*other = \\&foo;\n$bar = [ \\&other ];\n$d = Data::Dumper->new([\\&other,$bar],['*other','bar']);\n$d->Seen({ '*foo' => \\&foo });\nprint $d->Dump;\n\n\n########\n# sorting and filtering hash keys\n########\n\n$Data::Dumper::Sortkeys = \\&myfilter;\nmy $foo = { map { (ord, \"$$$\") } 'I'..'Q' };\nmy $bar = { %$foo };\nmy $baz = { reverse %$foo };\nprint Dumper [ $foo, $bar, $baz ];\n\nsub myfilter {\nmy ($hash) = @;\n# return an array ref containing the hash keys to dump\n# in the order that you want them to be dumped\nreturn [\n# Sort the keys of %$foo in reverse numeric order\n$hash eq $foo ? (sort {$b <=> $a} keys %$hash) :\n# Only dump the odd number keys of %$bar\n$hash eq $bar ? (grep {$ % 2} keys %$hash) :\n# Sort keys in default order for all other hashes\n(sort keys %$hash)\n];\n}\n",
                "subsections": []
            },
            "BUGS": {
                "content": "Due to limitations of Perl subroutine call semantics, you cannot pass an array or hash. Prepend\nit with a \"\\\" to pass its reference instead. This will be remedied in time, now that Perl has\nsubroutine prototypes. For now, you need to use the extended usage form, and prepend the name\nwith a \"*\" to output it as a hash or array.\n\n\"Data::Dumper\" cheats with CODE references. If a code reference is encountered in the structure\nbeing processed (and if you haven't set the \"Deparse\" flag), an anonymous subroutine that\ncontains the string '\"DUMMY\"' will be inserted in its place, and a warning will be printed if\n\"Purity\" is set. You can \"eval\" the result, but bear in mind that the anonymous sub that gets\ncreated is just a placeholder. Even using the \"Deparse\" flag will in some cases produce results\nthat behave differently after being passed to \"eval\"; see the documentation for B::Deparse.\n\nSCALAR objects have the weirdest looking \"bless\" workaround.\n\nPure Perl version of \"Data::Dumper\" escapes UTF-8 strings correctly only in Perl 5.8.0 and\nlater.\n\nNOTE\nStarting from Perl 5.8.1 different runs of Perl will have different ordering of hash keys. The\nchange was done for greater security, see \"Algorithmic Complexity Attacks\" in perlsec. This\nmeans that different runs of Perl will have different Data::Dumper outputs if the data contains\nhashes. If you need to have identical Data::Dumper outputs from different runs of Perl, use the\nenvironment variable PERLHASHSEED, see \"PERLHASHSEED\" in perlrun. Using this restores the\nold (platform-specific) ordering: an even prettier solution might be to use the \"Sortkeys\"\nfilter of Data::Dumper.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Gurusamy Sarathy gsar@activestate.com\n\nCopyright (c) 1996-2019 Gurusamy Sarathy. All rights reserved. This program is free software;\nyou can redistribute it and/or modify it under the same terms as Perl itself.\n",
                "subsections": []
            },
            "VERSION": {
                "content": "Version 2.179\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "",
                "subsections": [
                    {
                        "name": "perl",
                        "content": ""
                    }
                ]
            }
        }
    }
}