line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::FIREXFLY::Utils; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
138778
|
use 5.006; |
|
2
|
|
|
|
|
19
|
|
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
44
|
|
5
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
25
|
|
|
2
|
|
|
|
|
246
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Acme::FIREXFLY::Utils - Chapter 21 exercise from the book 'Intermediate Perl' |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Version 0.04 |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=cut |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Pracice creating a module and uploading to CPAN. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Use the sum method to calculate the sum of the passed in values: |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
use Acme::FIREXFLY::Utils; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $foo = Acme::FIREXFLY::Utils::sum( 1, 2, 3 ); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 sum( LIST ) |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Calculates sum of input |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub sum { |
40
|
2
|
|
|
2
|
1
|
84
|
my $sum = 0; |
41
|
2
|
|
|
|
|
8
|
$sum += $_ for @_; |
42
|
2
|
|
|
|
|
10
|
$sum; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 AUTHOR |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
firexfly, C<< >> |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 BUGS |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
53
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
54
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 SUPPORT |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
perldoc Acme::FIREXFLY::Utils |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
You can also look for information at: |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=over 4 |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker (report bugs here) |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
L |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
L |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item * CPAN Ratings |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
L |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item * Search CPAN |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
L |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=back |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Copyright 2018 firexfly. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
97
|
|
|
|
|
|
|
under the terms of the the Artistic License (2.0). You may obtain a |
98
|
|
|
|
|
|
|
copy of the full license at: |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
L |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Any use, modification, and distribution of the Standard or Modified |
103
|
|
|
|
|
|
|
Versions is governed by this Artistic License. By using, modifying or |
104
|
|
|
|
|
|
|
distributing the Package, you accept this license. Do not use, modify, |
105
|
|
|
|
|
|
|
or distribute the Package, if you do not accept this license. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
If your Modified Version has been derived from a Modified Version made |
108
|
|
|
|
|
|
|
by someone other than you, you are nevertheless required to ensure that |
109
|
|
|
|
|
|
|
your Modified Version complies with the requirements of this license. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
This license does not grant you the right to use any trademark, service |
112
|
|
|
|
|
|
|
mark, tradename, or logo of the Copyright Holder. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
This license includes the non-exclusive, worldwide, free-of-charge |
115
|
|
|
|
|
|
|
patent license to make, have made, use, offer to sell, sell, import and |
116
|
|
|
|
|
|
|
otherwise transfer the Package with respect to any patent claims |
117
|
|
|
|
|
|
|
licensable by the Copyright Holder that are necessarily infringed by the |
118
|
|
|
|
|
|
|
Package. If you institute patent litigation (including a cross-claim or |
119
|
|
|
|
|
|
|
counterclaim) against any party alleging that the Package constitutes |
120
|
|
|
|
|
|
|
direct or contributory patent infringement, then this Artistic License |
121
|
|
|
|
|
|
|
to you shall terminate on the date that such litigation is filed. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER |
124
|
|
|
|
|
|
|
AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. |
125
|
|
|
|
|
|
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
126
|
|
|
|
|
|
|
PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY |
127
|
|
|
|
|
|
|
YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR |
128
|
|
|
|
|
|
|
CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR |
129
|
|
|
|
|
|
|
CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, |
130
|
|
|
|
|
|
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=cut |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
1; # End of Acme::FIREXFLY::Utils |