line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::Crap; |
2
|
2
|
|
|
2
|
|
61547
|
use 5.010; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
122
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.001002'; |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
102
|
|
7
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
101
|
|
8
|
2
|
|
|
2
|
|
12
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
444
|
|
9
|
|
|
|
|
|
|
|
10
|
27
|
|
|
27
|
0
|
5873
|
sub deref { my ($self) = @_; return ${$self}; } |
|
27
|
|
|
|
|
31
|
|
|
27
|
|
|
|
|
480
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use overload ( |
13
|
9
|
|
|
9
|
|
21
|
q{!} => sub { Acme::Crap::Negated->new(&deref) }, |
14
|
2
|
|
|
|
|
25
|
q{""} => \&deref, |
15
|
|
|
|
|
|
|
q{0+} => \&deref, |
16
|
|
|
|
|
|
|
q{bool} => \&deref, |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
fallback => 1, |
19
|
2
|
|
|
2
|
|
4744
|
); |
|
2
|
|
|
|
|
3960
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub import { |
22
|
27
|
|
|
27
|
|
43
|
overload::constant q => sub { my $val = $_[1]; bless \$val, 'Acme::Crap' }; |
|
27
|
|
|
2
|
|
2270
|
|
|
2
|
|
|
|
|
23
|
|
23
|
|
|
|
|
|
|
|
24
|
2
|
|
|
2
|
|
302
|
no strict qw( refs ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1574
|
|
25
|
2
|
|
|
|
|
42
|
*{caller().'::crap'} = sub { |
26
|
5
|
|
|
5
|
|
1342
|
local $Acme::Crap::no_negation = 1; |
27
|
5
|
|
|
|
|
8
|
@_ = map {"$_"} @_; |
|
5
|
|
|
|
|
15
|
|
28
|
5
|
|
|
|
|
853
|
goto &Carp::carp; |
29
|
|
|
|
|
|
|
} |
30
|
2
|
|
|
|
|
51
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
package Acme::Crap::Negated; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub new { |
35
|
9
|
|
|
9
|
|
12
|
my ($class, $val) = @_; |
36
|
9
|
|
|
|
|
124
|
bless { val => $val, degree => 1 }, $class; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub value { |
40
|
9
|
|
|
9
|
|
2772
|
my ($self) = @_; |
41
|
9
|
100
|
|
|
|
24
|
if ($Acme::Crap::no_negation) { |
42
|
4
|
|
|
|
|
10
|
given ($self->{degree}) { |
43
|
4
|
|
|
|
|
16
|
when (1) { return ucfirst "$self->{val}!" } |
|
1
|
|
|
|
|
9
|
|
44
|
3
|
|
|
|
|
5
|
when (2) { return join q{}, map { ucfirst $_ } split /(\s+)/, "$self->{val}!!" } |
|
1
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
23
|
|
45
|
2
|
|
|
|
|
4
|
default { return uc $self->{val} . '!' x $_ } |
|
2
|
|
|
|
|
16
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
5
|
100
|
|
|
|
31
|
return !$self->{val} if $self->{degree} % 2; |
49
|
2
|
|
|
|
|
11
|
return !!$self->{val}; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
use overload ( |
53
|
17
|
|
|
17
|
|
20
|
q{!} => sub { my ($self) = @_; $self->{degree}++; return $self; }, |
|
17
|
|
|
|
|
17
|
|
|
17
|
|
|
|
|
216
|
|
54
|
2
|
|
|
|
|
21
|
q{""} => \&value, |
55
|
|
|
|
|
|
|
q{0+} => \&value, |
56
|
|
|
|
|
|
|
q{bool} => \&value, |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
fallback => 1, |
59
|
2
|
|
|
2
|
|
13
|
); |
|
2
|
|
|
|
|
3
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; # Magic true value required at end of module |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
__END__ |