line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Task::BeLike::FIBO; |
2
|
1
|
|
|
1
|
|
12692
|
use strict; |
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
114
|
|
3
|
1
|
|
|
1
|
|
22
|
use warnings; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
189
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.8'; |
5
|
|
|
|
|
|
|
1; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=encoding utf8 |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Task::BeLike::FIBO -- Leonardo Pisano a.k.a. Fibonacci |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
cpan Task::BeLike::FIBO |
16
|
|
|
|
|
|
|
perldoc Task::BeLike::FIBO |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Hi! I am L<FIBO|https://metacpan.org/author/FIBO> an italian mathematician. I graduated in 2005 at L<Università degli Studi di Genova|http://www.dima.unige.it/> and since then I work doing Business Intelligence and Web Analytics. My boss said: you need Perl. So I started using this language. I like many programming languages, but, Perl really help me to pay my rent. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
This is a primary about my habits and a collection of modules I use when I write Perl code. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 PACKAGE GUIDELINES |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Do not get crazy with automatic generators. I am a mathematician and a coder, not a corporation. |
27
|
|
|
|
|
|
|
Every package is different and has different needings. The followings are samples for files I usually need in a package. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Just use copy and paste and your brain! |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
The smack of a L<DRY|http://en.wikipedia.org/wiki/Don't_repeat_yourself> L<KISS|http://en.wikipedia.org/wiki/KISS_principle> is not that bad. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Learn from nature: stay as minimal as possible. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 FILES |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Follows a list of sample files of a package, C<MY::Package> for instance. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=over 4 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=item * |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
README.md |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
My-Package |
46
|
|
|
|
|
|
|
========== |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
My-Package description ... |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
To install, pray the mantra |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
perl Makefile.PL |
53
|
|
|
|
|
|
|
make |
54
|
|
|
|
|
|
|
make test |
55
|
|
|
|
|
|
|
make install |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
For more information point your browser to [online docs](https://metacpan.org/pod/My::Package) |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
-------- |
60
|
|
|
|
|
|
|
[![CPAN version](https://badge.fury.io/pl/My-Package-pm.svg)](https://metacpan.org/pod/My::Package) |
61
|
|
|
|
|
|
|
[![Build Status](https://travis-ci.org/fibo/My-Package-pm.png?branch=master)](https://travis-ci.org/fibo/My-Package-pm) |
62
|
|
|
|
|
|
|
[![Coverage Status](https://coveralls.io/repos/fibo/My-Package-pm/badge.png?branch=master)](https://coveralls.io/r/fibo/My-Package-pm?branch=master) |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=item * |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
.travis.yml |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
language: perl |
69
|
|
|
|
|
|
|
perl: |
70
|
|
|
|
|
|
|
- "5.18" |
71
|
|
|
|
|
|
|
- "5.16" |
72
|
|
|
|
|
|
|
- "5.14" |
73
|
|
|
|
|
|
|
- "5.12" |
74
|
|
|
|
|
|
|
- "5.10" |
75
|
|
|
|
|
|
|
- "5.8" |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item * |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
.gitignore |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
.* |
82
|
|
|
|
|
|
|
*~ |
83
|
|
|
|
|
|
|
!.gitignore |
84
|
|
|
|
|
|
|
!.travis.yml |
85
|
|
|
|
|
|
|
blib |
86
|
|
|
|
|
|
|
pm_to_blib |
87
|
|
|
|
|
|
|
Makefile* |
88
|
|
|
|
|
|
|
!Makefile.PL |
89
|
|
|
|
|
|
|
MANIFEST* |
90
|
|
|
|
|
|
|
!MANIFEST.SKIP |
91
|
|
|
|
|
|
|
*META.* |
92
|
|
|
|
|
|
|
*.tar.gz |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item * |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Makefile.PL |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
use strict; |
99
|
|
|
|
|
|
|
use warnings; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
use ExtUtils::MakeMaker 6.64; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
WriteMakefile( |
104
|
|
|
|
|
|
|
ABSTRACT_FROM => 'lib/My/Package.pm', |
105
|
|
|
|
|
|
|
VERSION_FROM => 'lib/My/Package.pm', |
106
|
|
|
|
|
|
|
AUTHOR => 'G. Casati <fibo@cpan.org>', |
107
|
|
|
|
|
|
|
NAME => 'My::Package', |
108
|
|
|
|
|
|
|
META_MERGE => { |
109
|
|
|
|
|
|
|
resources => { |
110
|
|
|
|
|
|
|
homepage => 'https://metacpan.org/pod/My::Package' |
111
|
|
|
|
|
|
|
license => 'http://g14n.info/mit-license', |
112
|
|
|
|
|
|
|
repository => 'http://github.com/fibo/My-Package-pm', |
113
|
|
|
|
|
|
|
bugtracker => 'http://github.com/fibo/My-Package-pm/issues', |
114
|
|
|
|
|
|
|
}, |
115
|
|
|
|
|
|
|
PREREQ_PM => { |
116
|
|
|
|
|
|
|
# 'Some::Package' => '0', |
117
|
|
|
|
|
|
|
# 'Other::Package' => '1.2.3', |
118
|
|
|
|
|
|
|
}, |
119
|
|
|
|
|
|
|
test => { TESTS => 't/*.t' }, |
120
|
|
|
|
|
|
|
TEST_REQUIRES => { |
121
|
|
|
|
|
|
|
'Test::Compile' => '1', |
122
|
|
|
|
|
|
|
'Test::More' => '1', |
123
|
|
|
|
|
|
|
'Test::Pod' => '1', |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
); |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=item * |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
MANIFEST.SKIP |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
^MANIFEST\.SKIP$ |
132
|
|
|
|
|
|
|
^MANIFEST\.bak$ |
133
|
|
|
|
|
|
|
^\. |
134
|
|
|
|
|
|
|
.*\.old$ |
135
|
|
|
|
|
|
|
.*\.bak$ |
136
|
|
|
|
|
|
|
\.tar\.gz$ |
137
|
|
|
|
|
|
|
^Makefile$ |
138
|
|
|
|
|
|
|
^MYMETA\. |
139
|
|
|
|
|
|
|
^blib |
140
|
|
|
|
|
|
|
^pm_to_blib |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=back |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head2 WORKFLOW |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=over 4 |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=item * |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
Start a feature branch |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
git checkout -b somefeature |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=item * |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
Write documentation about new feature. Then write tests to check it and code to implement it. |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=item * |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
Run tests |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
prove -l --state=save |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=item * |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
If some test does not pass, fix code and run tests that failed |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
prove -l --state=save,failed |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=item * |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
Merge feature branch and commit work |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
git rebase master |
175
|
|
|
|
|
|
|
git checkout master |
176
|
|
|
|
|
|
|
git merge somefeature |
177
|
|
|
|
|
|
|
git push |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=item * |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
Update version, use L<Semantic Versioning|http://semver.org/>. |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
Create a new release |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
perl Makefile.PL |
186
|
|
|
|
|
|
|
make |
187
|
|
|
|
|
|
|
make test |
188
|
|
|
|
|
|
|
make manifest |
189
|
|
|
|
|
|
|
make dist |
190
|
|
|
|
|
|
|
make realclean |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=item * |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
Upload to L<PAUSE|http://pause.perl.org/> |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
cpan-upload -u fibo My-Package-0.1.tar.gz |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=back |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=head1 STUFF INCLUDED |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=over 4 |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
=item * |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
L<CPAN> |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
See how to setup L<A CPAN client that works like a charm|http://g14n.info/2014/03/a-cpan-client-that-works-like-charm>. |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
=item * |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
L<CPAN::Uploader> |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=item * |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
L<ExtUtils::MakeMaker> version C<6.64>, cause I use the C<TEST_REQUIRES> option. |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
=item * |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
L<Perl::Tidy> |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
Use L<Perl::Tidy> defaults. Do not indent every source file automatically, indent by hand and use your creativity. |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
See Perl section in L<My Vim preferences|http://g14n.info/2013/07/my-vim-configuration#perl> to see how you can use L<perltidy> with Vim. |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
=item * |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
L<Test::Compile> |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
Create a C<t/_compile.t> file |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
use strict; |
234
|
|
|
|
|
|
|
use warnings; |
235
|
|
|
|
|
|
|
use Test::More; |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
eval "use Test::Compile"; |
238
|
|
|
|
|
|
|
Test::More->builder->BAIL_OUT(<<EOF) if $@; |
239
|
|
|
|
|
|
|
Test::Compile required for testing compilation |
240
|
|
|
|
|
|
|
EOF |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
all_pm_files_ok(); |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
=item * |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
L<Test::More> |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
=item * |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
L<Test::Pod> |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
Create a C<t/_pod.t> file |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
use strict; |
255
|
|
|
|
|
|
|
use warnings; |
256
|
|
|
|
|
|
|
use Test::More; |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
eval "use Test::Pod"; |
259
|
|
|
|
|
|
|
Test::More->builder->BAIL_OUT(<<EOF) if $@; |
260
|
|
|
|
|
|
|
Test::Pod required for testing compilation |
261
|
|
|
|
|
|
|
EOF |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
all_pod_files_ok(); |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
=back |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
=cut |
268
|
|
|
|
|
|
|
|