line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
304
|
|
|
304
|
|
9402545
|
use strict; |
|
304
|
|
|
|
|
811
|
|
|
304
|
|
|
|
|
13269
|
|
2
|
304
|
|
|
304
|
|
1823
|
use warnings; |
|
304
|
|
|
|
|
809
|
|
|
304
|
|
|
|
|
27926
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package IPC::Run::Fused; |
5
|
|
|
|
|
|
|
BEGIN { |
6
|
304
|
|
|
304
|
|
10241
|
$IPC::Run::Fused::AUTHORITY = 'cpan:KENTNL'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
{ |
9
|
|
|
|
|
|
|
$IPC::Run::Fused::VERSION = '0.04000100'; |
10
|
|
|
|
|
|
|
} |
11
|
304
|
|
|
304
|
|
6379
|
use 5.008000; |
|
304
|
|
|
|
|
913
|
|
|
304
|
|
|
|
|
18240
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# ABSTRACT: Capture Stdout/Stderr simultaneously as if it were one stream, painlessly. |
14
|
|
|
|
|
|
|
# |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
304
|
|
|
304
|
|
363386
|
use Sub::Exporter -setup => { exports => [ run_fused => \&_build_run_fused ], }; |
|
304
|
|
|
|
|
10810354
|
|
|
304
|
|
|
|
|
4063
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our %FAIL_CONTEXT; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _stringify { |
23
|
0
|
0
|
|
0
|
|
0
|
return 'undef' if not defined $_[0]; |
24
|
0
|
|
|
|
|
0
|
return qq{`$_[0]`}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _fail { |
28
|
0
|
|
|
|
|
0
|
my $errors = { |
29
|
|
|
|
|
|
|
'$?' => _stringify($?), |
30
|
|
|
|
|
|
|
'$!' => _stringify($!), |
31
|
|
|
|
|
|
|
'$^E' => _stringify($^E), |
32
|
|
|
|
|
|
|
'$@' => _stringify($@), |
33
|
0
|
|
|
0
|
|
0
|
( map { $_ => _stringify( $FAIL_CONTEXT{$_} ) } keys %FAIL_CONTEXT ) |
34
|
|
|
|
|
|
|
}; |
35
|
0
|
|
|
|
|
0
|
my $message = ''; |
36
|
0
|
|
|
|
|
0
|
$message .= qq{\n} . $_ for @_; |
37
|
0
|
|
|
|
|
0
|
$message .= sprintf qq{\n\t%s => %s}, $_, $errors->{$_} for sort keys %$errors; |
38
|
0
|
|
|
|
|
0
|
$message .= qq{\n}; |
39
|
0
|
|
|
|
|
0
|
require Carp; |
40
|
0
|
|
|
|
|
0
|
@_ = $message; |
41
|
0
|
|
|
|
|
0
|
goto \&Carp::confess; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub _build_run_fused { |
45
|
608
|
50
|
|
608
|
|
59789
|
if ( $^O eq 'MSWin32' ) { |
46
|
0
|
|
|
|
|
0
|
require IPC::Run::Fused::Win32; |
47
|
0
|
|
|
|
|
0
|
return \&IPC::Run::Fused::Win32::run_fused; |
48
|
|
|
|
|
|
|
} |
49
|
608
|
|
|
|
|
241603
|
require IPC::Run::Fused::POSIX; |
50
|
608
|
|
|
|
|
3244
|
return \&IPC::Run::Fused::POSIX::run_fused; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
{ |
53
|
|
|
|
|
|
|
*run_fused = _build_run_fused(); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |