Tie::FileHandle::MultiPlex - filehandle tie that sends output to many destinations


Tie-FileHandle-MultiPlex documentation Contained in the Tie-FileHandle-MultiPlex distribution.

Index


Code Index:

NAME

Top

Tie::FileHandle::MultiPlex - filehandle tie that sends output to many destinations

DESCRIPTION

Top

This module, when tied to a filehandle, will send all of its output to all of the sources listed upon its creation.

 Usage: tie *HANDLE, 'Tie::FileHandle::MultiPlex', *HANDLE1, *HANDLE2, *HANDLE3,...

TODO

Top

BUGS

Top

This is a new module and has not been thoroughly tested.

AUTHORS AND COPYRIGHT

Top


Tie-FileHandle-MultiPlex documentation Contained in the Tie-FileHandle-MultiPlex distribution.

#!/usr/local/bin/perl

package Tie::FileHandle::MultiPlex;

use base qw(Tie::FileHandle::Base);
use vars qw($VERSION);
$VERSION = 0.1;

# TIEHANDLE
# Usage: tie *HANDLE, 'Tie::FileHandle::MultiPlex', *HANDLE1, *HANDLE2, *HANDLE3,...
sub TIEHANDLE {
	bless [ map { \$_ } @_[1..$#_] ], $_[0];
}

# PRINT
sub PRINT {
	print $_ $_[1] for @{ $_[0] };
}

1;