{
    "mode": "perldoc",
    "parameter": "IO::Pipe",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/IO%3A%3APipe/json",
    "generated": "2026-06-13T19:44:40Z",
    "synopsis": "use IO::Pipe;\n$pipe = IO::Pipe->new();\nif($pid = fork()) { # Parent\n$pipe->reader();\nwhile(<$pipe>) {\n...\n}\n}\nelsif(defined $pid) { # Child\n$pipe->writer();\nprint $pipe ...\n}\nor\n$pipe = IO::Pipe->new();\n$pipe->reader(qw(ls -l));\nwhile(<$pipe>) {\n...\n}",
    "sections": {
        "NAME": {
            "content": "IO::Pipe - supply object methods for pipes\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use IO::Pipe;\n\n$pipe = IO::Pipe->new();\n\nif($pid = fork()) { # Parent\n$pipe->reader();\n\nwhile(<$pipe>) {\n...\n}\n\n}\nelsif(defined $pid) { # Child\n$pipe->writer();\n\nprint $pipe ...\n}\n\nor\n\n$pipe = IO::Pipe->new();\n\n$pipe->reader(qw(ls -l));\n\nwhile(<$pipe>) {\n...\n}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "\"IO::Pipe\" provides an interface to creating pipes between processes.\n",
            "subsections": []
        },
        "CONSTRUCTOR": {
            "content": "new ( [READER, WRITER] )\nCreates an \"IO::Pipe\", which is a reference to a newly created symbol (see the \"Symbol\"\npackage). \"IO::Pipe::new\" optionally takes two arguments, which should be objects blessed\ninto \"IO::Handle\", or a subclass thereof. These two objects will be used for the system call\nto \"pipe\". If no arguments are given then method \"handles\" is called on the new \"IO::Pipe\"\nobject.\n\nThese two handles are held in the array part of the GLOB until either \"reader\" or \"writer\"\nis called.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "reader ([ARGS])\nThe object is re-blessed into a sub-class of \"IO::Handle\", and becomes a handle at the\nreading end of the pipe. If \"ARGS\" are given then \"fork\" is called and \"ARGS\" are passed to\nexec.\n\nwriter ([ARGS])\nThe object is re-blessed into a sub-class of \"IO::Handle\", and becomes a handle at the\nwriting end of the pipe. If \"ARGS\" are given then \"fork\" is called and \"ARGS\" are passed to\nexec.\n\nhandles ()\nThis method is called during construction by \"IO::Pipe::new\" on the newly created \"IO::Pipe\"\nobject. It returns an array of two objects blessed into \"IO::Pipe::End\", or a subclass\nthereof.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "IO::Handle\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Graham Barr. Currently maintained by the Perl Porters. Please report all bugs to\n<perlbug@perl.org>.\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (c) 1996-8 Graham Barr <gbarr@pobox.com>. All rights reserved. This program is free\nsoftware; you can redistribute it and/or modify it under the same terms as Perl itself.\n",
            "subsections": []
        }
    },
    "summary": "IO::Pipe - supply object methods for pipes",
    "flags": [],
    "examples": [],
    "see_also": []
}