line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
55636
|
use v5.12; |
|
3
|
|
|
|
|
18
|
|
2
|
3
|
|
|
3
|
|
13
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
57
|
|
3
|
3
|
|
|
3
|
|
10
|
use warnings FATAL => 'all'; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
109
|
|
4
|
3
|
|
|
3
|
|
10
|
no warnings qw(void once uninitialized numeric); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
184
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package PerlX::Define; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
9
|
|
|
|
|
|
|
our $VERSION = '0.101'; |
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
16
|
use B (); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
43
|
|
12
|
3
|
|
|
3
|
|
1103
|
use Keyword::Simple (); |
|
3
|
|
|
|
|
52428
|
|
|
3
|
|
|
|
|
68
|
|
13
|
3
|
|
|
3
|
|
1009
|
use namespace::clean (); |
|
3
|
|
|
|
|
33476
|
|
|
3
|
|
|
|
|
919
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub import |
16
|
|
|
|
|
|
|
{ |
17
|
6
|
|
|
6
|
|
49
|
shift; |
18
|
|
|
|
|
|
|
|
19
|
6
|
|
|
|
|
23
|
my ($caller, $file, $line) = caller; |
20
|
|
|
|
|
|
|
|
21
|
6
|
100
|
|
|
|
33
|
if (@_) |
22
|
|
|
|
|
|
|
{ |
23
|
3
|
|
|
|
|
7
|
my ($name, $value) = @_; |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
|
|
4
|
local $@; |
26
|
3
|
50
|
|
|
|
26
|
ref($value) |
27
|
|
|
|
|
|
|
? eval qq[ |
28
|
0
|
|
|
|
|
0
|
package $caller;\n#line $line ${\ B::perlstring($file) } |
29
|
|
|
|
|
|
|
sub $name () { \$value }; |
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
] |
32
|
|
|
|
|
|
|
: eval qq[ |
33
|
3
|
|
|
|
|
29
|
package $caller;\n#line $line ${\ B::perlstring($file) } |
34
|
3
|
|
|
|
|
154
|
sub $name () { ${\ B::perlstring($value) } }; |
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
]; |
37
|
|
|
|
|
|
|
|
38
|
3
|
100
|
|
|
|
47
|
$@ ? die($@) : return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Keyword::Simple::define('define' => sub |
42
|
|
|
|
|
|
|
{ |
43
|
3
|
|
|
3
|
|
126
|
my $line = shift; |
44
|
3
|
50
|
|
|
|
28
|
my ($whitespace1, $name, $whitespace2, $equals) = |
45
|
|
|
|
|
|
|
( $$line =~ m{\A([\n\s]*)(\w+)([\n\s]*)(=\>?)}s ) |
46
|
|
|
|
|
|
|
or Carp::croak("Syntax error near 'define'"); |
47
|
3
|
|
|
|
|
8
|
my $len = length($whitespace1. $name. $whitespace2. $equals); |
48
|
3
|
|
|
|
|
85
|
substr($$line, 0, $len) = "; use PerlX::Define $name => "; |
49
|
3
|
|
|
|
|
27
|
}); |
50
|
|
|
|
|
|
|
|
51
|
3
|
|
|
|
|
94
|
'namespace::clean'->import( |
52
|
|
|
|
|
|
|
-cleanee => $caller, |
53
|
|
|
|
|
|
|
'define', |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |