line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- coding: utf-8 -*- |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Crane::Base; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
7439
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
213
|
|
8
|
5
|
|
|
5
|
|
27
|
use warnings; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
162
|
|
9
|
5
|
|
|
5
|
|
6403
|
use utf8; |
|
5
|
|
|
|
|
53
|
|
|
5
|
|
|
|
|
27
|
|
10
|
5
|
|
|
5
|
|
298
|
use feature qw( :5.14 ); |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
812
|
|
11
|
5
|
|
|
5
|
|
5725
|
use open qw( :std :utf8 ); |
|
5
|
|
|
|
|
8398
|
|
|
5
|
|
|
|
|
32
|
|
12
|
5
|
|
|
5
|
|
14312
|
use base qw( Exporter ); |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
883
|
|
13
|
|
|
|
|
|
|
|
14
|
5
|
|
|
5
|
|
30
|
use Carp; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
647
|
|
15
|
5
|
|
|
5
|
|
6024
|
use English qw( -no_match_vars ); |
|
5
|
|
|
|
|
31314
|
|
|
5
|
|
|
|
|
42
|
|
16
|
5
|
|
|
5
|
|
8817
|
use IO::Handle; |
|
5
|
|
|
|
|
50829
|
|
|
5
|
|
|
|
|
430
|
|
17
|
5
|
|
|
5
|
|
6987
|
use Readonly; |
|
5
|
|
|
|
|
18905
|
|
|
5
|
|
|
|
|
438
|
|
18
|
5
|
|
|
5
|
|
7663
|
use Try::Tiny; |
|
5
|
|
|
|
|
9416
|
|
|
5
|
|
|
|
|
1276
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our @EXPORT = ( |
22
|
|
|
|
|
|
|
@Carp::EXPORT, |
23
|
|
|
|
|
|
|
@English::EXPORT, |
24
|
|
|
|
|
|
|
@Try::Tiny::EXPORT, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub import { |
29
|
|
|
|
|
|
|
|
30
|
18
|
|
|
18
|
|
695
|
my ( $class, @isa ) = @_; |
31
|
|
|
|
|
|
|
|
32
|
18
|
|
|
|
|
43
|
my $caller = caller; |
33
|
|
|
|
|
|
|
|
34
|
18
|
|
|
|
|
279
|
strict->import(); |
35
|
18
|
|
|
|
|
361
|
warnings->import(); |
36
|
18
|
|
|
|
|
112
|
utf8->import(); |
37
|
18
|
|
|
|
|
1467
|
feature->import(qw( :5.14 )); |
38
|
|
|
|
|
|
|
|
39
|
18
|
100
|
|
|
|
75
|
if ( scalar @isa ) { |
40
|
13
|
|
|
|
|
26
|
foreach my $isa ( @isa ) { |
41
|
13
|
50
|
|
|
|
1280
|
if ( eval "require $isa" ) { |
42
|
5
|
|
|
5
|
|
123
|
no strict 'refs'; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
759
|
|
43
|
13
|
|
|
|
|
19
|
push @{ "${caller}::ISA" }, $isa; |
|
13
|
|
|
|
|
256
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
18
|
|
|
|
|
8889
|
$class->export_to_level(1, $caller); |
49
|
|
|
|
|
|
|
|
50
|
18
|
|
|
|
|
564
|
return; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 NAME |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Crane::Base - Minimal base class for Crane projects |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 SYNOPSIS |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
use Crane::Base; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 DESCRIPTION |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Import this package is equivalent to: |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
use strict; |
73
|
|
|
|
|
|
|
use warnings; |
74
|
|
|
|
|
|
|
use utf8; |
75
|
|
|
|
|
|
|
use feature qw( :5.14 ); |
76
|
|
|
|
|
|
|
use open qw( :std :utf8 ); |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
use Carp; |
79
|
|
|
|
|
|
|
use English qw( -no_match_vars ); |
80
|
|
|
|
|
|
|
use IO::Handle; |
81
|
|
|
|
|
|
|
use Readonly; |
82
|
|
|
|
|
|
|
use Try::Tiny; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 EXAMPLES |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 Script usage |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
use Crane::Base; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
say 'Hello!' or confess($OS_ERROR); |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head2 Package usage |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
package Example; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
use Crane::Base qw( Exporter ); |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Readonly::Scalar(our $CONST => 'value'); |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
our @EXPORT = qw( |
104
|
|
|
|
|
|
|
&example |
105
|
|
|
|
|
|
|
$CONST |
106
|
|
|
|
|
|
|
); |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub example { |
109
|
|
|
|
|
|
|
say 'This is an example!' or confess($OS_ERROR); |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
1; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 BUGS |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
118
|
|
|
|
|
|
|
L or to |
119
|
|
|
|
|
|
|
L. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 AUTHOR |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Tema Novikov, |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Copyright (C) 2013-2014 Tema Novikov. |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under |
132
|
|
|
|
|
|
|
the terms of the Artistic License 2.0. For details, see the full text of the |
133
|
|
|
|
|
|
|
license in the file LICENSE. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head1 SEE ALSO |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=over |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=item * B |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
L |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=item * B |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
L |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=back |