File Coverage

blib/lib/App/Timestamper/Filter/TS.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 2 2 100.0
total 21 21 100.0


line stmt bran cond sub pod time code
1             package App::Timestamper::Filter::TS;
2             $App::Timestamper::Filter::TS::VERSION = '0.2.1';
3 1     1   97082 use strict;
  1         11  
  1         29  
4 1     1   5 use warnings;
  1         2  
  1         29  
5              
6 1     1   5 use Time::HiRes qw/ time /;
  1         2  
  1         5  
7              
8             sub new
9             {
10 1     1 1 103 return bless {}, shift;
11             }
12              
13             sub fh_filter
14             {
15 1     1 1 4289 my ( $self, $in, $out ) = @_;
16              
17 1         8 while ( my $l = <$in> )
18             {
19 4         1048 $out->( sprintf( '%.9f', time() ) . "\t" . $l );
20             }
21              
22 1         313 return;
23             }
24              
25             1;
26              
27             __END__