line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Power::FromLine; |
2
|
3
|
|
|
3
|
|
16
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
103
|
|
3
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
67
|
|
4
|
3
|
|
|
3
|
|
14
|
use utf8; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
23
|
|
5
|
3
|
|
|
3
|
|
92
|
use 5.010_001; |
|
3
|
|
|
|
|
16
|
|
|
3
|
|
|
|
|
114
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
19
|
use Cwd (); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
66
|
|
8
|
3
|
|
|
3
|
|
17
|
use File::Spec; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
901
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $BASE_DIR = Cwd::getcwd(); |
11
|
|
|
|
|
|
|
our %FILECACHE; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub inspect_line { |
14
|
3
|
|
|
3
|
0
|
7
|
my $level = shift; |
15
|
|
|
|
|
|
|
|
16
|
3
|
|
|
|
|
63
|
my ($package, $filename, $line_no) = caller($level+1); |
17
|
|
|
|
|
|
|
my $line = sub { |
18
|
3
|
50
|
|
3
|
|
12
|
undef $filename if $filename eq '-e'; |
19
|
3
|
50
|
|
|
|
9
|
if (defined $filename) { |
20
|
3
|
|
|
|
|
107
|
$filename = File::Spec->rel2abs($filename, $BASE_DIR); |
21
|
|
|
|
|
|
|
my $file = $FILECACHE{$filename} ||= [ |
22
|
3
|
|
100
|
|
|
17
|
do { |
23
|
|
|
|
|
|
|
# Do not die if we can't open the file |
24
|
2
|
50
|
|
|
|
123
|
open my $fh, '<', $filename |
25
|
|
|
|
|
|
|
or return ''; |
26
|
|
|
|
|
|
|
<$fh> |
27
|
2
|
|
|
|
|
109
|
} |
28
|
|
|
|
|
|
|
]; |
29
|
3
|
|
|
|
|
11
|
my $line = $file->[ $line_no - 1 ]; |
30
|
3
|
|
|
|
|
28
|
$line =~ s{^\s+|\s+$}{}g; |
31
|
3
|
|
|
|
|
9
|
$line; |
32
|
|
|
|
|
|
|
} else { |
33
|
0
|
|
|
|
|
0
|
""; |
34
|
|
|
|
|
|
|
} |
35
|
3
|
|
|
|
|
18
|
}->(); |
36
|
3
|
|
|
|
|
24
|
return ($package, $filename, $line_no, $line); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|