line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mars; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
440
|
use 5.018; |
|
3
|
|
|
|
|
7
|
|
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
12
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
49
|
|
6
|
3
|
|
|
3
|
|
11
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
239
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# AUTHORITY |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:AWNCORP'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# IMPORT |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub import { |
19
|
1
|
|
|
1
|
|
7
|
my ($self, @args) = @_; |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
1
|
my $from = caller; |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
3
|
|
17
|
no strict 'refs'; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
603
|
|
24
|
|
|
|
|
|
|
|
25
|
1
|
50
|
|
|
|
2
|
if (!*{"${from}::true"}{"CODE"}) { |
|
1
|
|
|
|
|
6
|
|
26
|
1
|
|
|
|
|
2
|
*{"${from}::true"} = \&true; |
|
1
|
|
|
|
|
3
|
|
27
|
|
|
|
|
|
|
} |
28
|
1
|
50
|
|
|
|
2
|
if (!*{"${from}::false"}{"CODE"}) { |
|
1
|
|
|
|
|
4
|
|
29
|
1
|
|
|
|
|
1
|
*{"${from}::false"} = \&false; |
|
1
|
|
|
|
|
2
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
18
|
return $self; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub false { |
36
|
12
|
|
|
12
|
1
|
105
|
require Scalar::Util; |
37
|
12
|
|
|
|
|
65
|
state $false = Scalar::Util::dualvar(0, "0"); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub true { |
41
|
11
|
|
|
11
|
1
|
45
|
require Scalar::Util; |
42
|
11
|
|
|
|
|
58
|
state $true = Scalar::Util::dualvar(1, "1"); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 NAME |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Mars - OO Framework |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 ABSTRACT |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
OO Framework for Perl 5 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 VERSION |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
0.04 |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 SYNOPSIS |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
package User; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
use Mars::Class; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
attr 'fname'; |
74
|
|
|
|
|
|
|
attr 'lname'; |
75
|
|
|
|
|
|
|
attr 'email'; |
76
|
|
|
|
|
|
|
attr 'trust'; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub BUILD { |
79
|
|
|
|
|
|
|
shift->{trust} = true; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
package main; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
my $user = User->new( |
85
|
|
|
|
|
|
|
fname => 'Elliot', |
86
|
|
|
|
|
|
|
lname => 'Alderson', |
87
|
|
|
|
|
|
|
); |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
# bless({ |
90
|
|
|
|
|
|
|
# 'fname' => 'Elliot', |
91
|
|
|
|
|
|
|
# 'lname' => 'Alderson', |
92
|
|
|
|
|
|
|
# 'trust' => 1 |
93
|
|
|
|
|
|
|
# }, 'User') |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=cut |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 DESCRIPTION |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Mars is a simple yet powerful framework for object-oriented programming which |
100
|
|
|
|
|
|
|
lets you hook into all aspects of the L<"class"|Mars::Class>, |
101
|
|
|
|
|
|
|
L<"role"|Mars::Role>, L<"interface"|Mars::Role>, and object |
102
|
|
|
|
|
|
|
L<"lifecycle"|Mars::Kind/METHODS>, from class declaration and object |
103
|
|
|
|
|
|
|
L<"construction"|Mars::Kind/BLESS>, to object |
104
|
|
|
|
|
|
|
L<"deconstruction"|Mars::Kind/DESTROY>. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=cut |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 FUNCTIONS |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
This package provides the following functions: |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=cut |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head2 false |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
false() (Bool) |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
The false function returns a falsy boolean value which is designed to be |
119
|
|
|
|
|
|
|
practically indistinguishable from the conventional numerical C<0> value. This |
120
|
|
|
|
|
|
|
function is always exported unless a routine of the same name already exists. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
I> |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=over 4 |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=item false example 1 |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
package main; |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
use Mars; |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
my $false = false; |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
# 0 |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=back |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=over 4 |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=item false example 2 |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
package main; |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
use Mars; |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
my $true = !false; |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
# 1 |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=back |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=cut |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head2 true |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
true() (Bool) |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
The true function returns a truthy boolean value which is designed to be |
159
|
|
|
|
|
|
|
practically indistinguishable from the conventional numerical C<1> value. This |
160
|
|
|
|
|
|
|
function is always exported unless a routine of the same name already exists. |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
I> |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=over 4 |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=item true example 1 |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
package main; |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
use Mars; |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
my $true = true; |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
# 1 |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=back |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=over 4 |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=item true example 2 |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
package main; |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
use Mars; |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
my $false = !true; |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
# 0 |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=back |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=cut |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
=head1 AUTHORS |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
Awncorp, C |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=cut |