NAME
PerlIO::tee - Multiplex output layer
SYNOPSIS
open my $out, '>>:tee', $file, @sources;
$out->push_layer(tee => $file);
$out->push_layer(tee => ">> $file");
$out->push_layer(tee => \$scalar);
$out->push_layer(tee => \*FILEHANDLE);
EXAMPLE
Here is an minimal implementation of tee(1)
.
#!/usr/bin/perl -w
# Usage: $0 files...
use strict;
use PerlIO::Util;
STDOUT->push_layer(tee => $_) for @ARGV;
while(read STDIN, $_, 2**12){
print;
}
__END__
SEE ALSO
AUTHOR
Goro Fuji <gfuji (at) cpan.org>
LICENCE AND COPYRIGHT
Copyright (c) 2008, Goro Fuji <gfuji (at) cpan.org>. Some rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.