File Coverage

blib/lib/POSIX/Run/Capture.pm
Criterion Covered Total %
statement 18 19 94.7
branch n/a
condition n/a
subroutine 6 7 85.7
pod 1 2 50.0
total 25 28 89.2


line stmt bran cond sub pod time code
1             package POSIX::Run::Capture;
2              
3 11     11   400723 use 5.016001;
  11         114  
4 11     11   61 use strict;
  11         19  
  11         262  
5 11     11   51 use warnings;
  11         21  
  11         1677  
6              
7             require Exporter;
8              
9             our @ISA = qw(Exporter);
10              
11             # Items to export into callers namespace by default. Note: do not export
12             # names by default without a very good reason. Use EXPORT_OK instead.
13             # Do not simply export all your public functions/methods/constants.
14              
15             # This allows declaration use POSIX::Run::Capture ':all';
16             # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
17             # will save memory.
18             our %EXPORT_TAGS = ( 'all' => [ qw(
19             SD_STDOUT
20             SD_STDERR
21             ) ],
22             'std' => [ qw(
23             SD_STDOUT
24             SD_STDERR
25             ) ] );
26              
27             our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
28              
29             #our @EXPORT = qw();
30              
31             our $VERSION = '1.03';
32              
33             require XSLoader;
34             XSLoader::load('POSIX::Run::Capture', $VERSION);
35              
36             use constant {
37 11         2767 SD_STDOUT => 1,
38             SD_STDERR => 2
39 11     11   78 };
  11     0   22  
40              
41             # Preloaded methods go here.
42             sub get_lines {
43 0     5 1 0 my ($self, $fd) = @_;
44 5         73219 my @lines;
45              
46 5         54 $self->rewind($fd);
47 5         104 while (my $s = $self->next_line($fd)) {
48 5         190 push @lines, $s;
49             }
50 232         1344 return \@lines;
51             }
52              
53             sub set_argv {
54 5     3 0 136 my $self = shift;
55 3         3819 $self->set_argv_ref([@_]);
56             }
57              
58             1;
59             __END__