9.4 Tying FilehandlesTied filehandles call a user-defined object whenever you read from or write to a filehandle, as shown in Table 9.4 . Note that the tie statement takes a typeglob, not a bareword.
This method can be used to simulate a file or process with a test driver or to monitor access to a filehandle for silently logging a conversation (like the tee(1) command). Tk, which we will study in detail in Chapter 14, User Interfaces with Tk , supports ties to let you redirect I/O to its text widget. We will look at a small example of this feature when we study that widget. Copyright © 2001 O'Reilly & Associates. All rights reserved. |
|