Install Perl 5.8.8
[msysgit.git] / mingw / html / ext / IO / lib / IO / Pipe.html
blobe50203f401c2f7d733b41a6a9d6804541c9092d4
1 <?xml version="1.0" ?>
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">
4 <head>
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:" />
8 </head>
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">&nbsp;IO::Pipe - supply object methods for pipes</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
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>
30 </ul>
31 <!-- INDEX END -->
33 <hr />
34 <p>
35 </p>
36 <h1><a name="name">NAME</a></h1>
37 <p>IO::Pipe - supply object methods for pipes</p>
38 <p>
39 </p>
40 <hr />
41 <h1><a name="synopsis">SYNOPSIS</a></h1>
42 <pre>
43 use IO::Pipe;</pre>
44 <pre>
45 $pipe = new IO::Pipe;</pre>
46 <pre>
47 if($pid = fork()) { # Parent
48 $pipe-&gt;reader();</pre>
49 <pre>
50 while(&lt;$pipe&gt;) {
51 ...
52 }</pre>
53 <pre>
55 elsif(defined $pid) { # Child
56 $pipe-&gt;writer();</pre>
57 <pre>
58 print $pipe ...
59 }</pre>
60 <pre>
61 or</pre>
62 <pre>
63 $pipe = new IO::Pipe;</pre>
64 <pre>
65 $pipe-&gt;reader(qw(ls -l));</pre>
66 <pre>
67 while(&lt;$pipe&gt;) {
68 ...
69 }</pre>
70 <p>
71 </p>
72 <hr />
73 <h1><a name="description">DESCRIPTION</a></h1>
74 <p><code>IO::Pipe</code> provides an interface to creating pipes between
75 processes.</p>
76 <p>
77 </p>
78 <hr />
79 <h1><a name="constructor">CONSTRUCTOR</a></h1>
80 <dl>
81 <dt><strong><a name="item_new">new ( [READER, WRITER] )</a></strong>
83 <dd>
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>
90 </dd>
91 <dd>
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>
94 </dd>
95 </li>
96 </dl>
97 <p>
98 </p>
99 <hr />
100 <h1><a name="methods">METHODS</a></h1>
101 <dl>
102 <dt><strong><a name="item_reader">reader ([ARGS])</a></strong>
104 <dd>
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>
108 </dd>
109 </li>
110 <dt><strong><a name="item_writer">writer ([ARGS])</a></strong>
112 <dd>
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>
116 </dd>
117 </li>
118 <dt><strong><a name="item_handles">handles ()</a></strong>
120 <dd>
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>
124 </dd>
125 </li>
126 </dl>
128 </p>
129 <hr />
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>
133 </p>
134 <hr />
135 <h1><a name="author">AUTHOR</a></h1>
136 <p>Graham Barr. Currently maintained by the Perl Porters. Please report all
137 bugs to &lt;<a href="mailto:perl5-porters@perl.org">perl5-porters@perl.org</a>&gt;.</p>
139 </p>
140 <hr />
141 <h1><a name="copyright">COPYRIGHT</a></h1>
142 <p>Copyright (c) 1996-8 Graham Barr &lt;<a href="mailto:gbarr@pobox.com">gbarr@pobox.com</a>&gt;. 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">&nbsp;IO::Pipe - supply object methods for pipes</span></strong></big>
148 </td></tr>
149 </table>
151 </body>
153 </html>