IO::Tee man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]

Tee(3)		      User Contributed Perl Documentation		Tee(3)

NAME
       IO::Tee - Multiplex output to multiple output handles

SYNOPSIS
	   use IO::Tee;

	   $tee = IO::Tee->new($handle1, $handle2);
	   print $tee "foo", "bar";
	   my $input = <$tee>;

DESCRIPTION
       "IO::Tee" objects can be used to multiplex input and output in two dif‐
       ferent ways.  The first way is to multiplex output to zero or more out‐
       put handles.  The "IO::Tee" constructor, given a list of output han‐
       dles, returns a tied handle that can be written to.  When written to
       (using print or printf), the "IO::Tee" object multiplexes the output to
       the list of handles originally passed to the constructor.  As a short‐
       cut, 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 second way is to multiplex input from one input handle to zero or
       more output handles as it is being read.	 The "IO::Tee" constructor,
       given an input handle followed by a list of output handles, returns a
       tied handle that can be read from as well as written to.	 When written
       to, the "IO::Tee" object multiplexes the output to all handles passed
       to the constructor, as described in the previous paragraph.  When read
       from, the "IO::Tee" object reads from the input handle given as the
       first argument to the "IO::Tee" constructor, then writes any data read
       to the output handles given as the remaining arguments to the construc‐
       tor.

       The "IO::Tee" class supports certain "IO::Handle" and "IO::File" meth‐
       ods related to input and 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 associ‐
       ated handles returned TRUE indicating success:

       close
       truncate
       write
       syswrite
       format_write
       formline
       fcntl
       ioctl
       flush
       clearerr
       seek

       The following methods perform input multiplexing as described above:

       read
       sysread
       readline
       getc
       gets
       eof
       getline
       getlines

       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

       The following methods are directly passed on to the input handle given
       as the first argument to the "IO::Tee" constructor:

       input_record_separator
       input_line_number

       Note that the return value of input multiplexing methods (such as
       "print") is always the return value of the input action, not the return
       value of subsequent output actions.  In particular, no error is indi‐
       cated by the return value if the input action itself succeeds but sub‐
       sequent output multiplexing fails.

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;

	   $tee = new IO::Tee('</etc/passwd', \*STDOUT);
	   my @lines = <$tee>;
	   print scalar(@lines);

AUTHOR
       Chung-chieh Shan, ken@digitas.harvard.edu

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.

3rd Berkeley Distribution	  perl v5.6.1				Tee(3)
[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net