-
Notifications
You must be signed in to change notification settings - Fork 7
/
README
73 lines (60 loc) · 2.1 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
NAME
IO::Tee - Multiplex output to multiple output handles
SYNOPSIS
use IO::Tee;
$tee = IO::Tee->new($handle1, $handle2);
print $tee "foo", "bar";
DESCRIPTION
The `IO::Tee' constructor, given a list of output handles, returns a
tied handle that can be written to but not read from. When written to
(using print or printf), it multiplexes the output to the list of
handles originally passed to the constructor. As a shortcut, you can
also directly pass a string or an array reference to the constructor, in
which case `IO::File::new' is called for you with the specified argument
or arguments.
The `IO::Tee' class supports certain `IO::Handle' and `IO::File' methods
related to output. In particular, the following methods will iterate
themselves over all handles associated with the `IO::Tee' object, and
return TRUE indicating success if and only if all associated handles
returned TRUE indicating success:
close
truncate
write
syswrite
format_write
formline
fcntl
ioctl
flush
clearerr
seek
Additionally, the following methods can be used to set (but not
retrieve) the current values of output-related state variables on all
associated handles:
autoflush
output_field_separator
output_record_separator
format_page_number
format_lines_per_page
format_lines_left
format_name
format_top_name
format_line_break_characters
format_formfeed
EXAMPLE
use IO::Tee;
use IO::File;
my $tee = new IO::Tee(\*STDOUT,
new IO::File(">tt1.out"), ">tt2.out");
print join(' ', $tee->handles), "\n";
for (1..10) { print $tee $_, "\n" }
for (1..10) { $tee->print($_, "\n") }
$tee->flush;
AUTHOR
Chung-chieh Shan, [email protected]
COPYRIGHT
Copyright (c) 1998-2001 Chung-chieh Shan. All rights reserved. This
program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
SEE ALSO
the perlfunc manpage, the IO::Handle manpage, the IO::File manpage.