{
    "mode": "perldoc",
    "parameter": "Dpkg::Control::HashCore",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Dpkg%3A%3AControl%3A%3AHashCore/json",
    "generated": "2026-06-13T20:19:26Z",
    "sections": {
        "NAME": {
            "content": "Dpkg::Control::HashCore - parse and manipulate a block of RFC822-like fields\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The Dpkg::Control::Hash class is a hash-like representation of a set of RFC822-like fields. The\nfields names are case insensitive and are always capitalized the same when output (see\nfieldcapitalize function in Dpkg::Control::Fields). The order in which fields have been set is\nremembered and is used to be able to dump back the same content. The output order can also be\noverridden if needed.\n\nYou can store arbitrary values in the hash, they will always be properly escaped in the output\nto conform to the syntax of control files. This is relevant mainly for multilines values: while\nthe first line is always output unchanged directly after the field name, supplementary lines are\nmodified. Empty lines and lines containing only dots are prefixed with \" .\" (space + dot) while\nother lines are prefixed with a single space.\n\nDuring parsing, trailing spaces are stripped on all lines while leading spaces are stripped only\non the first line of each field.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "$c = Dpkg::Control::Hash->new(%opts)\nCreates a new object with the indicated options. Supported options are:\n\nallowpgp\nConfigures the parser to accept OpenPGP signatures around the control information.\nValue can be 0 (default) or 1.\n\nallowduplicate\nConfigures the parser to allow duplicate fields in the control information. The last\nvalue overrides any previous values. Value can be 0 (default) or 1.\n\nkeepduplicate\nConfigure the parser to keep values for duplicate fields found in the control\ninformation (when allowduplicate is enabled), as array references. Value can be 0\n(default) or 1.\n\ndropempty\nDefines if empty fields are dropped during the output. Value can be 0 (default) or\n1.\n\nname    The user friendly name of the information stored in the object. It might be used in\nsome error messages or warnings. A default name might be set depending on the type.\n\nispgpsigned\nSet by the parser (starting in dpkg 1.17.0) if it finds an OpenPGP signature around\nthe control information. Value can be 0 (default) or 1, and undef when the option is\nnot supported by the code (in versions older than dpkg 1.17.0).\n\n$c->setoptions($option, %opts)\nChanges the value of one or more options.\n\n$value = $c->getoption($option)\nReturns the value of the corresponding option.\n\n$c->parseerror($file, $fmt, ...)\nPrints an error message and dies on syntax parse errors.\n\n$c->parse($fh, $description)\nParse a control file from the given filehandle. Exits in case of errors. $description is\nused to describe the filehandle, ideally it's a filename or a description of where the data\ncomes from. It's used in error messages. When called multiple times, the parsed fields are\naccumulated.\n\nReturns true if some fields have been parsed.\n\n$c->load($file)\nParse the content of $file. Exits in case of errors. Returns true if some fields have been\nparsed.\n\n$c->findcustomfield($name)\nScan the fields and look for a user specific field whose name matches the following regex:\n/X[SBC]*-$name/i. Return the name of the field found or undef if nothing has been found.\n\n$c->getcustomfield($name)\nIdentify a user field and retrieve its value.\n\n$str = $c->output()\n\"$c\"\nGet a string representation of the control information. The fields are sorted in the order\nin which they have been read or set except if the order has been overridden with\nsetoutputorder().\n\n$c->output($fh)\nPrint the string representation of the control information to a filehandle.\n\n$c->save($filename)\nWrite the string representation of the control information to a file.\n\n$c->setoutputorder(@fields)\nDefine the order in which fields will be displayed in the output() method.\n\n$c->applysubstvars($substvars)\nUpdate all fields by replacing the variables references with the corresponding value stored\nin the Dpkg::Substvars object.\n",
            "subsections": []
        },
        "CHANGES": {
            "content": "Version 1.02 (dpkg 1.21.0)\nNew option: \"keepduplicate\" in new().\n\nVersion 1.01 (dpkg 1.17.2)\nNew method: $c->parseerror().\n\nVersion 1.00 (dpkg 1.17.0)\nMark the module as public.\n",
            "subsections": []
        }
    },
    "summary": "Dpkg::Control::HashCore - parse and manipulate a block of RFC822-like fields",
    "flags": [],
    "examples": [],
    "see_also": []
}