line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Fuckin::Lazy; |
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1110
|
use Data::Dumper; |
|
1
|
|
|
|
|
18815
|
|
|
1
|
|
|
|
|
89
|
|
6
|
1
|
|
|
1
|
|
12
|
use base 'Exporter'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
98
|
|
7
|
1
|
|
|
1
|
|
6
|
use Carp qw/croak/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
543
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = "0.000002"; |
10
|
|
|
|
|
|
|
our @EXPORT = ('LAZY'); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub produce_data { |
13
|
4
|
|
|
4
|
0
|
9
|
my ($struct, $line, $match) = @_; |
14
|
4
|
|
|
|
|
4
|
local $Data::Dumper::Purity = 1; |
15
|
4
|
|
|
|
|
5
|
local $Data::Dumper::Useqq = 1; |
16
|
4
|
|
|
|
|
11
|
local $Data::Dumper::Deepcopy = 1; |
17
|
4
|
|
|
|
|
9
|
local $Data::Dumper::Sortkeys = 1; |
18
|
4
|
|
|
|
|
7
|
local $Data::Dumper::Indent = 0; |
19
|
|
|
|
|
|
|
|
20
|
4
|
|
|
|
|
10
|
my $data = Dumper($struct); |
21
|
|
|
|
|
|
|
|
22
|
4
|
|
|
|
|
261
|
$data =~ s/\$VAR1 = //; |
23
|
4
|
|
|
|
|
12
|
$data =~ s/;$//; |
24
|
4
|
|
|
|
|
8
|
chomp($data); |
25
|
|
|
|
|
|
|
|
26
|
4
|
|
|
|
|
10
|
return $data; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub LAZY { |
30
|
4
|
|
|
4
|
1
|
9
|
my ($struct) = @_; |
31
|
|
|
|
|
|
|
|
32
|
4
|
|
|
|
|
185
|
my ($caller, $file, $line) = caller(); |
33
|
|
|
|
|
|
|
|
34
|
4
|
50
|
|
|
|
1033
|
open(my $fh, '<', $file) || die "Could not open $file: $!"; |
35
|
|
|
|
|
|
|
|
36
|
4
|
|
|
|
|
189
|
my $updated = 0; |
37
|
4
|
|
|
|
|
6
|
my @lines; |
38
|
4
|
|
|
|
|
239
|
while (my $line = <$fh>) { |
39
|
84
|
100
|
|
|
|
193
|
if ($line =~ m/(LAZY|Fuckin'Lazy|Fuckin::Lazy)\s*\(/) { |
40
|
4
|
|
|
|
|
9
|
my $match = $1; |
41
|
4
|
50
|
|
|
|
69
|
croak "$1() must be called with parentheses, and must be given a scalar variable for an arg." |
42
|
|
|
|
|
|
|
unless $line =~ m/$match\(\s*\$[0-9A-Za-z_]+\s*\)/; |
43
|
|
|
|
|
|
|
|
44
|
4
|
|
|
|
|
10
|
my $data = produce_data($struct, $line, $match); |
45
|
4
|
|
|
|
|
70
|
$line =~ s/$match\(\s*\$[0-9A-Za-z_]+\s*\)/$data/; |
46
|
|
|
|
|
|
|
} |
47
|
84
|
|
|
|
|
263
|
push @lines => $line; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
4
|
|
|
|
|
39
|
close($fh); |
51
|
4
|
50
|
|
|
|
313
|
open($fh, '>', $file) || die "Cannot open $file for writing: $!"; |
52
|
|
|
|
|
|
|
|
53
|
4
|
|
|
|
|
21
|
print $fh @lines; |
54
|
|
|
|
|
|
|
|
55
|
4
|
|
|
|
|
173
|
return $struct; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
*Fuckin::Lazy = \&LAZY; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
__END__ |