File Coverage

blib/lib/Tie/FileHandle/MultiPlex.pm
Criterion Covered Total %
statement 6 10 60.0
branch n/a
condition n/a
subroutine 2 4 50.0
pod n/a
total 8 14 57.1


line stmt bran cond sub pod time code
1             #!/usr/local/bin/perl
2            
3             =head1 NAME
4            
5             Tie::FileHandle::MultiPlex - filehandle tie that sends output to many destinations
6            
7             =head1 DESCRIPTION
8            
9             This module, when tied to a filehandle, will send all of its output to all
10             of the sources listed upon its creation.
11            
12             Usage: tie *HANDLE, 'Tie::FileHandle::MultiPlex', *HANDLE1, *HANDLE2, *HANDLE3,...
13            
14             =head1 TODO
15            
16             =over 4
17            
18             =item *
19            
20             test.pl
21            
22             =back
23            
24             =head1 BUGS
25            
26             This is a new module and has not been thoroughly tested.
27            
28             =cut
29            
30             package Tie::FileHandle::MultiPlex;
31            
32 1     1   6280 use base qw(Tie::FileHandle::Base);
  1         1  
  1         923  
33 1     1   663 use vars qw($VERSION);
  1         1  
  1         261  
34             $VERSION = 0.1;
35            
36             # TIEHANDLE
37             # Usage: tie *HANDLE, 'Tie::FileHandle::MultiPlex', *HANDLE1, *HANDLE2, *HANDLE3,...
38             sub TIEHANDLE {
39 0     0     bless [ map { \$_ } @_[1..$#_] ], $_[0];
  0            
40             }
41            
42             # PRINT
43             sub PRINT {
44 0     0     print $_ $_[1] for @{ $_[0] };
  0            
45             }
46            
47             1;
48            
49             =head1 AUTHORS AND COPYRIGHT
50            
51             Written by Robby Walker ( robwalker@cpan.org ) for Point Writer ( http://www.pointwriter.com/ ).
52            
53             You may redistribute/modify/etc. this module under the same terms as Perl itself.