line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package POSIX::Run::Capture; |
2
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
355982
|
use 5.016001; |
|
11
|
|
|
|
|
105
|
|
4
|
11
|
|
|
11
|
|
58
|
use strict; |
|
11
|
|
|
|
|
19
|
|
|
11
|
|
|
|
|
256
|
|
5
|
11
|
|
|
11
|
|
76
|
use warnings; |
|
11
|
|
|
|
|
19
|
|
|
11
|
|
|
|
|
1559
|
|
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.01'; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
require XSLoader; |
34
|
|
|
|
|
|
|
XSLoader::load('POSIX::Run::Capture', $VERSION); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
use constant { |
37
|
11
|
|
|
|
|
2786
|
SD_STDOUT => 1, |
38
|
|
|
|
|
|
|
SD_STDERR => 2 |
39
|
11
|
|
|
11
|
|
77
|
}; |
|
11
|
|
|
0
|
|
19
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# Preloaded methods go here. |
42
|
|
|
|
|
|
|
sub get_lines { |
43
|
0
|
|
|
5
|
1
|
0
|
my ($self, $fd) = @_; |
44
|
5
|
|
|
|
|
87741
|
my @lines; |
45
|
|
|
|
|
|
|
|
46
|
5
|
|
|
|
|
47
|
$self->rewind($fd); |
47
|
5
|
|
|
|
|
70
|
while (my $s = $self->next_line($fd)) { |
48
|
5
|
|
|
|
|
129
|
push @lines, $s; |
49
|
|
|
|
|
|
|
} |
50
|
232
|
|
|
|
|
1440
|
return \@lines; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub set_argv { |
54
|
5
|
|
|
3
|
0
|
52
|
my $self = shift; |
55
|
3
|
|
|
|
|
3577
|
$self->set_argv_ref([@_]); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
__END__ |