{
    "mode": "perldoc",
    "parameter": "Dpkg::IPC",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Dpkg%3A%3AIPC/json",
    "generated": "2026-06-12T13:38:39Z",
    "sections": {
        "NAME": {
            "content": "Dpkg::IPC - helper functions for IPC\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Dpkg::IPC offers helper functions to allow you to execute other programs in an easy, yet\nflexible way, while hiding all the gory details of IPC (Inter-Process Communication) from you.\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "$pid = spawn(%opts)\nCreates a child process and executes another program in it. The arguments are interpreted as\na hash of options, specifying how to handle the in and output of the program to execute.\nReturns the pid of the child process (unless the waitchild option was given).\n\nAny error will cause the function to exit with one of the Dpkg::ErrorHandling functions.\n\nOptions:\n\nexec\nCan be either a scalar, i.e. the name of the program to be executed, or an array\nreference, i.e. the name of the program plus additional arguments. Note that the program\nwill never be executed via the shell, so you can't specify additional arguments in the\nscalar string and you can't use any shell facilities like globbing.\n\nMandatory Option.\n\nfromfile, tofile, errortofile\nFilename as scalar. Standard input/output/error of the child process will be redirected\nto the file specified.\n\nfromhandle, tohandle, errortohandle\nFilehandle. Standard input/output/error of the child process will be dup'ed from the\nhandle.\n\nfrompipe, topipe, errortopipe\nScalar reference or object based on IO::Handle. A pipe will be opened for each of the\ntwo options and either the reading (\"topipe\" and \"errortopipe\") or the writing end\n(\"frompipe\") will be returned in the referenced scalar. Standard input/output/error of\nthe child process will be dup'ed to the other ends of the pipes.\n\nfromstring, tostring, errortostring\nScalar reference. Standard input/output/error of the child process will be redirected to\nthe string given as reference. Note that it wouldn't be strictly necessary to use a\nscalar reference for \"fromstring\", as the string is not modified in any way. This was\nchosen only for reasons of symmetry with \"tostring\" and \"errortostring\". \"tostring\"\nand \"errortostring\" imply the \"waitchild\" option.\n\nwaitchild\nScalar. If containing a true value, waitchild() will be called before returning. The\nreturn value of spawn() will be a true value, not the pid.\n\nnocheck\nScalar. Option of the waitchild() call.\n\ntimeout\nScalar. Option of the waitchild() call.\n\nchdir\nScalar. The child process will chdir in the indicated directory before calling exec.\n\nenv Hash reference. The child process will populate %ENV with the items of the hash before\ncalling exec. This allows exporting environment variables.\n\ndeleteenv\nArray reference. The child process will remove all environment variables listed in the\narray before calling exec.\n\nsig Hash reference. The child process will populate %SIG with the items of the hash before\ncalling exec. This allows setting signal dispositions.\n\ndeletesig\nArray reference. The child process will reset all signals listed in the array to their\ndefault dispositions before calling exec.\n",
            "subsections": [
                {
                    "name": "wait_child",
                    "content": "Takes as first argument the pid of the process to wait for. Remaining arguments are taken as\na hash of options. Returns nothing. Fails if the child has been ended by a signal or if it\nexited non-zero.\n\nOptions:\n\ncmdline\nString to identify the child process in error messages. Defaults to \"child process\".\n\nnocheck\nIf true do not check the return status of the child (and thus do not fail it has been\nkilled or if it exited with a non-zero return code).\n\ntimeout\nSet a maximum time to wait for the process, after that kill the process and fail with an\nerror message.\n"
                }
            ]
        },
        "CHANGES": {
            "content": "Version 1.02 (dpkg 1.18.0)\nChange options: waitchild() now kills the process when reaching the 'timeout'.\n\nVersion 1.01 (dpkg 1.17.11)\nNew options: spawn() now accepts 'sig' and 'deletesig'.\n\nVersion 1.00 (dpkg 1.15.6)\nMark the module as public.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Dpkg, Dpkg::ErrorHandling\n",
            "subsections": []
        }
    },
    "summary": "Dpkg::IPC - helper functions for IPC",
    "flags": [],
    "examples": [],
    "see_also": []
}