Install Perl 5.8.8
[msysgit.git] / mingw / html / lib / Tie / Handle.html
blob61b6f7a135abb91f25c6351fee0ba29b6a74dedb
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>Tie::StdHandle - base class definitions for tied handles</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;Tie::StdHandle - base class definitions for tied handles</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="#more_information">MORE INFORMATION</a></li>
26 <li><a href="#compatibility">COMPATIBILITY</a></li>
27 </ul>
28 <!-- INDEX END -->
30 <hr />
31 <p>
32 </p>
33 <h1><a name="name">NAME</a></h1>
34 <p>Tie::Handle, Tie::StdHandle - base class definitions for tied handles</p>
35 <p>
36 </p>
37 <hr />
38 <h1><a name="synopsis">SYNOPSIS</a></h1>
39 <pre>
40 package NewHandle;
41 require Tie::Handle;</pre>
42 <pre>
43 @ISA = qw(Tie::Handle);</pre>
44 <pre>
45 sub READ { ... } # Provide a needed method
46 sub TIEHANDLE { ... } # Overrides inherited method</pre>
47 <pre>
48 package main;</pre>
49 <pre>
50 tie *FH, 'NewHandle';</pre>
51 <p>
52 </p>
53 <hr />
54 <h1><a name="description">DESCRIPTION</a></h1>
55 <p>This module provides some skeletal methods for handle-tying classes. See
56 <a href="file://C|\msysgit\mingw\html/pod/perltie.html">the perltie manpage</a> for a list of the functions required in tying a handle to a package.
57 The basic <strong>Tie::Handle</strong> package provides a <code>new</code> method, as well as methods
58 <code>TIEHANDLE</code>, <code>PRINT</code>, <code>PRINTF</code> and <code>GETC</code>.</p>
59 <p>For developers wishing to write their own tied-handle classes, the methods
60 are summarized below. The <a href="file://C|\msysgit\mingw\html/pod/perltie.html">the perltie manpage</a> section not only documents these, but
61 has sample code as well:</p>
62 <dl>
63 <dt><strong><a name="item_tiehandle_classname_2c_list">TIEHANDLE classname, LIST</a></strong>
65 <dd>
66 <p>The method invoked by the command <code>tie *glob, classname</code>. Associates a new
67 glob instance with the specified class. <code>LIST</code> would represent additional
68 arguments (along the lines of <a href="file://C|\msysgit\mingw\html/lib/AnyDBM_File.html">the AnyDBM_File manpage</a> and compatriots) needed to
69 complete the association.</p>
70 </dd>
71 </li>
72 <dt><strong><a name="item_write_this_2c_scalar_2c_length_2c_offset">WRITE this, scalar, length, offset</a></strong>
74 <dd>
75 <p>Write <em>length</em> bytes of data from <em>scalar</em> starting at <em>offset</em>.</p>
76 </dd>
77 </li>
78 <dt><strong><a name="item_print_this_2c_list">PRINT this, LIST</a></strong>
80 <dd>
81 <p>Print the values in <em>LIST</em></p>
82 </dd>
83 </li>
84 <dt><strong><a name="item_printf_this_2c_format_2c_list">PRINTF this, format, LIST</a></strong>
86 <dd>
87 <p>Print the values in <em>LIST</em> using <em>format</em></p>
88 </dd>
89 </li>
90 <dt><strong><a name="item_read_this_2c_scalar_2c_length_2c_offset">READ this, scalar, length, offset</a></strong>
92 <dd>
93 <p>Read <em>length</em> bytes of data into <em>scalar</em> starting at <em>offset</em>.</p>
94 </dd>
95 </li>
96 <dt><strong><a name="item_readline_this">READLINE this</a></strong>
98 <dd>
99 <p>Read a single line</p>
100 </dd>
101 </li>
102 <dt><strong><a name="item_getc_this">GETC this</a></strong>
104 <dd>
105 <p>Get a single character</p>
106 </dd>
107 </li>
108 <dt><strong><a name="item_close_this">CLOSE this</a></strong>
110 <dd>
111 <p>Close the handle</p>
112 </dd>
113 </li>
114 <dt><strong><a name="item_open_this_2c_filename">OPEN this, filename</a></strong>
116 <dd>
117 <p>(Re-)open the handle</p>
118 </dd>
119 </li>
120 <dt><strong><a name="item_binmode_this">BINMODE this</a></strong>
122 <dd>
123 <p>Specify content is binary</p>
124 </dd>
125 </li>
126 <dt><strong><a name="item_eof_this">EOF this</a></strong>
128 <dd>
129 <p>Test for end of file.</p>
130 </dd>
131 </li>
132 <dt><strong><a name="item_tell_this">TELL this</a></strong>
134 <dd>
135 <p>Return position in the file.</p>
136 </dd>
137 </li>
138 <dt><strong><a name="item_seek_this_2c_offset_2c_whence">SEEK this, offset, whence</a></strong>
140 <dd>
141 <p>Position the file.</p>
142 </dd>
143 <dd>
144 <p>Test for end of file.</p>
145 </dd>
146 </li>
147 <dt><strong><a name="item_destroy_this">DESTROY this</a></strong>
149 <dd>
150 <p>Free the storage associated with the tied handle referenced by <em>this</em>.
151 This is rarely needed, as Perl manages its memory quite well. But the
152 option exists, should a class wish to perform specific actions upon the
153 destruction of an instance.</p>
154 </dd>
155 </li>
156 </dl>
158 </p>
159 <hr />
160 <h1><a name="more_information">MORE INFORMATION</a></h1>
161 <p>The <a href="file://C|\msysgit\mingw\html/pod/perltie.html">the perltie manpage</a> section contains an example of tying handles.</p>
163 </p>
164 <hr />
165 <h1><a name="compatibility">COMPATIBILITY</a></h1>
166 <p>This version of Tie::Handle is neither related to nor compatible with
167 the Tie::Handle (3.0) module available on CPAN. It was due to an
168 accident that two modules with the same name appeared. The namespace
169 clash has been cleared in favor of this module that comes with the
170 perl core in September 2000 and accordingly the version number has
171 been bumped up to 4.0.</p>
172 <table border="0" width="100%" cellspacing="0" cellpadding="3">
173 <tr><td class="block" style="background-color: #cccccc" valign="middle">
174 <big><strong><span class="block">&nbsp;Tie::StdHandle - base class definitions for tied handles</span></strong></big>
175 </td></tr>
176 </table>
178 </body>
180 </html>