2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml">
5 <title>IO::Pipe - supply object methods for pipes
</title>
6 <meta http-equiv=
"content-type" content=
"text/html; charset=utf-8" />
7 <link rev=
"made" href=
"mailto:" />
10 <body style=
"background-color: white">
11 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
12 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
13 <big><strong><span class=
"block"> IO::Pipe - supply object methods for pipes
</span></strong></big>
17 <p><a name=
"__index__"></a></p>
22 <li><a href=
"#name">NAME
</a></li>
23 <li><a href=
"#synopsis">SYNOPSIS
</a></li>
24 <li><a href=
"#description">DESCRIPTION
</a></li>
25 <li><a href=
"#constructor">CONSTRUCTOR
</a></li>
26 <li><a href=
"#methods">METHODS
</a></li>
27 <li><a href=
"#see_also">SEE ALSO
</a></li>
28 <li><a href=
"#author">AUTHOR
</a></li>
29 <li><a href=
"#copyright">COPYRIGHT
</a></li>
36 <h1><a name=
"name">NAME
</a></h1>
37 <p>IO::Pipe - supply object methods for pipes
</p>
41 <h1><a name=
"synopsis">SYNOPSIS
</a></h1>
45 $pipe = new IO::Pipe;
</pre>
47 if($pid = fork()) { # Parent
48 $pipe-
>reader();
</pre>
50 while(
<$pipe
>) {
55 elsif(defined $pid) { # Child
56 $pipe-
>writer();
</pre>
63 $pipe = new IO::Pipe;
</pre>
65 $pipe-
>reader(qw(ls -l));
</pre>
67 while(
<$pipe
>) {
73 <h1><a name=
"description">DESCRIPTION
</a></h1>
74 <p><code>IO::Pipe
</code> provides an interface to creating pipes between
79 <h1><a name=
"constructor">CONSTRUCTOR
</a></h1>
81 <dt><strong><a name=
"item_new">new ( [READER, WRITER] )
</a></strong>
84 <p>Creates an
<code>IO::Pipe
</code>, which is a reference to a newly created symbol
85 (see the
<code>Symbol
</code> package).
<code>IO::Pipe::new
</code> optionally takes two
86 arguments, which should be objects blessed into
<code>IO::Handle
</code>, or a
87 subclass thereof. These two objects will be used for the system call
88 to
<code>pipe
</code>. If no arguments are given then method
<a href=
"#item_handles"><code>handles
</code></a> is called
89 on the new
<code>IO::Pipe
</code> object.
</p>
92 <p>These two handles are held in the array part of the GLOB until either
93 <a href=
"#item_reader"><code>reader
</code></a> or
<a href=
"#item_writer"><code>writer
</code></a> is called.
</p>
100 <h1><a name=
"methods">METHODS
</a></h1>
102 <dt><strong><a name=
"item_reader">reader ([ARGS])
</a></strong>
105 <p>The object is re-blessed into a sub-class of
<code>IO::Handle
</code>, and becomes a
106 handle at the reading end of the pipe. If
<code>ARGS
</code> are given then
<code>fork
</code>
107 is called and
<code>ARGS
</code> are passed to exec.
</p>
110 <dt><strong><a name=
"item_writer">writer ([ARGS])
</a></strong>
113 <p>The object is re-blessed into a sub-class of
<code>IO::Handle
</code>, and becomes a
114 handle at the writing end of the pipe. If
<code>ARGS
</code> are given then
<code>fork
</code>
115 is called and
<code>ARGS
</code> are passed to exec.
</p>
118 <dt><strong><a name=
"item_handles">handles ()
</a></strong>
121 <p>This method is called during construction by
<code>IO::Pipe::new
</code>
122 on the newly created
<code>IO::Pipe
</code> object. It returns an array of two objects
123 blessed into
<code>IO::Pipe::End
</code>, or a subclass thereof.
</p>
130 <h1><a name=
"see_also">SEE ALSO
</a></h1>
131 <p><a href=
"file://C|\msysgit\mingw\html/lib/IO/Handle.html">the IO::Handle manpage
</a></p>
135 <h1><a name=
"author">AUTHOR
</a></h1>
136 <p>Graham Barr. Currently maintained by the Perl Porters. Please report all
137 bugs to
<<a href=
"mailto:perl5-porters@perl.org">perl5-porters@perl.org
</a>>.
</p>
141 <h1><a name=
"copyright">COPYRIGHT
</a></h1>
142 <p>Copyright (c)
1996-
8 Graham Barr
<<a href=
"mailto:gbarr@pobox.com">gbarr@pobox.com
</a>>. All rights reserved.
143 This program is free software; you can redistribute it and/or
144 modify it under the same terms as Perl itself.
</p>
145 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
146 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
147 <big><strong><span class=
"block"> IO::Pipe - supply object methods for pipes
</span></strong></big>